/* =====================================================
   VAULT V11 - Main Stylesheet
   Professional Dark Theme Design System
   Pink Accent Theme
   ===================================================== */

/* =====================================================
   CSS Variables - Pink Accent Theme (Overrides)
   Uses variables.css as base
   ===================================================== */

:root {
    /* Legacy variables for compatibility */
    --bg-primary: rgb(14, 14, 14);
    --bg-secondary: rgba(29, 29, 29, 0.7);
    --bg-tertiary: #1a1a1a;
    --bg-card: #1a1a1a;
    --accent-primary: #ff6b9d;
    --accent-secondary: #e05080;
    --accent-hover: #ff8fb3;
    --accent-glow: 0 0 10px rgba(255, 107, 157, 0.4), 0 0 20px rgba(255, 107, 157, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #3b3b3b;
    --border-primary: #3b3b3b;
    --success: #00d97e;
    --warning: #ffc107;
    --danger: #e74c3c;
}

/* =====================================================
   Base Reset & Globals
   ===================================================== */

body {
    font-family: var(--font-family, 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* =====================================================
   Typography
   ===================================================== */

h1, h2 {
    font-family: var(--font-family, 'Satoshi', sans-serif);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h3, h4, h5, h6 {
    font-family: var(--font-family, 'Satoshi', sans-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    font-family: var(--font-family, 'Satoshi', sans-serif);
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* =====================================================
   Top Navigation
   ===================================================== */

.top-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
    border: 1px solid var(--border-primary);
    min-width: 320px;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}

.nav-left .nav-logo {
    font-size: 20px;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
}

.nav-left .nav-logo i {
    font-size: 18px;
}

.nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-right a, .nav-right button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-secondary);
    cursor: url(/stuff/icons/pointer.png), pointer !important;
    transition: all 0.15s ease-in-out;
    font-size: 16px;
    text-decoration: none;
}

.nav-right a:hover, .nav-right button:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}
    color: var(--accent-primary);
}

.nav-right a.active {
    background: var(--accent-bg);
    color: var(--accent-primary);
}

/* =====================================================
   Home Page
   ===================================================== */

.home-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 100px 20px;
    position: relative;
    z-index: 1;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Quick Links */
.quick-links {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-link {
    width: 56px;
    height: 56px;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.quick-link:hover {
    transform: translateY(-4px);
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.quick-link img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.quick-link i {
    font-size: 24px;
    color: var(--text-secondary);
}

.quick-link:hover i {
    color: var(--accent-primary);
}

/* Search Box */
.search-box {
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
}

.search-box input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:hover {
    border-color: var(--accent-primary);
}

.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 5px #ff6b9d, 0 0 15px #ff6b9d, 0 0 25px #ff6b9d;
    width: 100%;
}

/* Action Buttons */
.action-btn {
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

.action-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Footer Link */
.footer-link {
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-primary);
}

/* =====================================================
   Bottom Bar
   ===================================================== */

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-top: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-dot.offline {
    background: var(--error);
}

.status-dot.connecting {
    background: var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.footer-right {
    display: flex;
    gap: 8px;
}

.footer-right button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-right button:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* =====================================================
   Page Layouts
   ===================================================== */

.page-main {
    padding: 80px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Search */
.page-search {
    max-width: 400px;
    margin: 0 auto 24px;
}

.page-search input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.page-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Category Tabs */
.tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.tab.active {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

/* =====================================================
   Grid System
   ===================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.grid.large {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Card */
.card {
    background: var(--bg-card);
    border: 3px solid transparent;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: url(/stuff/icons/pointer.png), pointer !important;
}

.card:hover {
    transform: scale(1.05);
    border-color: #45ffb8;
    box-shadow: 0 0 10px #ff6b9d, 0 0 20px rgba(255, 107, 157, 0.3);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-badge.new {
    background: var(--success);
}

.card-badge.popular {
    background: var(--warning);
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: url(/stuff/icons/pointer.png), pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.card:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: var(--danger);
    opacity: 1;
}

.card-content {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    font-family: 'Quicksand SemiBold', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 12px;
    font-family: 'Quicksand Medium', sans-serif;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-meta i {
    font-size: 10px;
    color: var(--accent-primary);
}

/* =====================================================
   Modal
   ===================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-primary);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Form Elements */
.setting-group {
    margin-bottom: 16px;
}

.setting-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.setting-group select,
.setting-group input[type="text"] {
    width: 100%;
    padding: 15px 12px;
    background: #080808;
    border: 3px solid #141414;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Quicksand Bold', sans-serif;
    outline: none;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.setting-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.setting-group select:hover,
.setting-group input:hover {
    border-color: var(--accent-primary);
}

.setting-group select:focus,
.setting-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 5px #ff6b9d, 0 0 15px #ff6b9d, 0 0 25px #ff6b9d;
}

.setting-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Quicksand SemiBold', sans-serif;
    cursor: url(/stuff/icons/pointer.png), pointer !important;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 3px solid var(--border-color);
    background: var(--bg-tertiary);
    color: white;
}

.btn:hover {
    background-color: var(--accent-secondary);
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow);
}

.btn:active {
    transform: scale(0.9);
}

.btn-primary {
    background: var(--accent-secondary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary);
    box-shadow: var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

/* =====================================================
   Toast Notifications
   ===================================================== */

.toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 24px var(--shadow-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--success-bg);
    color: var(--success);
}

.toast.error .toast-icon {
    background: var(--error-bg);
    color: var(--error);
}

.toast.warning .toast-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
}

/* =====================================================
   Loading States
   ===================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* =====================================================
   Empty States
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* =====================================================
   Proxy Page
   ===================================================== */

.proxy-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.proxy-backends {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.backend-option {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.backend-option:hover {
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
}

.backend-option.active {
    border-color: var(--accent-primary);
    background: var(--accent-bg);
}

.backend-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.backend-option.active i {
    color: var(--accent-primary);
}

.backend-option span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.backend-option.active span {
    color: var(--accent-primary);
}

.proxy-status {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.proxy-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.proxy-status-row:not(:last-child) {
    border-bottom: 1px solid var(--border-primary);
}

.proxy-status-label {
    color: var(--text-muted);
    font-size: 13px;
}

.proxy-status-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.proxy-status-value .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.proxy-status-value .dot.error {
    background: var(--error);
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
    .top-nav {
        min-width: auto;
        width: calc(100% - 32px);
        padding: 10px 16px;
    }
    
    .nav-right a, .nav-right button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .proxy-backends {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 16px;
        padding: 20px;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-main {
        padding: 70px 16px 70px;
    }
    
    .tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
