@import url('https://db.onlinewebfonts.com/c/43fa78fecfcf4b56cdc9c3d2802e87b0?family=Samsung+Sharp+Sans');
@import url('https://cdn.jsdelivr.net/gh/repalash/gilroy-free-webfont@fonts/Gilroy-Light.css');

/* ===== VIOLET / PURPLE THEME — Matching Site Colors ===== */
:root {
    /* Primary — Site Violet */
    --primary-color: #7335e1;
    --primary-dark: #5b21b6;
    --primary-light: #8b5cf6;
    --primary-gradient: linear-gradient(135deg, #7335e1 0%, #a855f7 100%);

    /* Backgrounds — Dark Purple-Tinted */
    --bg-light: #131221;
    --card-bg: #1a1828;
    --sidebar-bg: #0f0e1a;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;

    /* Sidebar */
    --sidebar-text: #cbd5e1;

    /* Borders & Shadows */
    --border-color: rgba(255, 255, 255, 0.07);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 24px rgba(115, 53, 225, 0.2);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-light);
    font-family: 'Gilroy', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Global Typography */
h1, h2, h3, h4, h5, h6,
.dashboard-header h1,
.greeting-title,
.sidebar-section-title,
.brand-logo span,
.username,
.stat-value-compact,
.service-name,
.modal-content h2,
.country-name,
.price-tag,
.survey-modal h2 {
    font-family: 'Samsung Sharp Sans', 'SamsungSharpSans', system-ui, -apple-system, sans-serif !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

p,
span,
.greeting-subtitle,
.refund-info-box span,
.stat-label,
.stock-badge,
.loading-overlay p,
.sidebar-nav a span,
.user-info span.balance,
.survey-modal p,
.survey-option {
    font-family: 'Gilroy', system-ui, -apple-system, sans-serif !important;
    font-weight: 300 !important;
}

strong {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — mobile tarayıcı UI'ını dışarıda bırakır */
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border-color);
    overflow: hidden; /* sidebar'ın kendisi kaymaz */
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.close-sidebar-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    transition: color 0.2s;
}

.close-sidebar-btn:hover {
    color: #fff;
}

.sidebar-nav {
    padding: 20px 12px;
    flex: 1 1 0;      /* kalan tüm yüksekliği al */
    min-height: 0;    /* flex shrink için şart */
    overflow-y: auto; /* sadece nav scroll olur */
    overflow-x: hidden;
    /* Scrollbar still */
    scrollbar-width: thin;
    scrollbar-color: rgba(115, 53, 225, 0.25) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(115, 53, 225, 0.3); border-radius: 4px; }

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 18px 18px 6px 18px;
    font-family: 'Gilroy', system-ui, sans-serif !important;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin: 10px 18px;
}

.nav-badge {
    background: linear-gradient(135deg, #7335e1, #a855f7);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    margin-bottom: 2px;
    color: #94a3b8 !important;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.2px;
    position: relative;
    font-family: 'Gilroy', system-ui, sans-serif !important;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    color: #64748b !important;
    font-size: 15px;
    transition: color 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

.nav-item:hover i {
    color: #ffffff !important;
}

.nav-item.active {
    background: rgba(115, 53, 225, 0.12) !important;
    color: #a78bfa !important;
    font-weight: 600;
}

.nav-item.active i {
    color: #8b5cf6 !important;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.username {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance {
    display: block;
    font-size: 0.8rem;
    color: #a78bfa;
    font-weight: 600 !important;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.18) !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    /* Cam (glassmorphism) blur efekti */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(8px); }
}

.sidebar-overlay.active {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 280px;
    padding: 24px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* ===== HEADER ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 10px 0;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s;
}

.hamburger-btn:hover {
    transform: scale(1.1);
}

/* ===== COMPACT STATS ===== */
.stats-container-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-compact {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow);
    border-color: rgba(115, 53, 225, 0.25);
}

.stat-card-compact:hover::before {
    opacity: 1;
}

.stat-icon-compact {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border-radius: 14px;
    background: rgba(115, 53, 225, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(115, 53, 225, 0.2);
    flex-shrink: 0;
}

.stat-info-compact {
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value-compact {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ===== SEARCH BOX ===== */
.search-box-container {
    position: relative;
    margin-bottom: 24px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
}

.search-input-main {
    width: 100%;
    padding: 15px 20px 15px 52px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    color: #ffffff;
    font-family: 'Gilroy', system-ui, sans-serif;
}

.search-input-main::placeholder {
    color: var(--text-light);
}

.search-input-main:focus {
    outline: none;
    border-color: rgba(115, 53, 225, 0.5);
    box-shadow: 0 0 0 4px rgba(115, 53, 225, 0.15);
    background: var(--card-bg);
    color: #ffffff;
}

/* ===== SERVICE SECTION ===== */
.service-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
    border-radius: 16px;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(115, 53, 225, 0.3);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(115, 53, 225, 0.2);
}

.service-icon-wrapper {
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    border-radius: 10px;
    background: transparent;
    padding: 0;
}

.service-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    image-rendering: high-quality;
    transition: transform 0.3s;
}

.service-card:hover .service-icon-img {
    transform: scale(1.08);
}

.service-name {
    font-size: 0.83rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.service-subtitle {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.service-bottom-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.active-count {
    font-size: 0.68rem;
    color: var(--text-light);
}

.arrow-icon {
    font-size: 0.68rem;
    color: #475569;
    transition: color 0.2s;
}

.service-card:hover .arrow-icon {
    color: #8b5cf6;
}

.btn-show-all {
    display: block;
    margin: 24px auto 0;
    padding: 12px 36px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(115, 53, 225, 0.35);
    font-family: 'Gilroy', system-ui, sans-serif;
}

.btn-show-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(115, 53, 225, 0.45);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--card-bg);
    margin: 3% auto;
    padding: 0;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(115, 53, 225, 0.15);
    border: 1px solid var(--border-color);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.modal-content h2 {
    padding: 22px 30px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(115, 53, 225, 0.08), rgba(168, 85, 247, 0.05));
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    color: var(--text-light);
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}

.close-modal:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-content input[type="text"] {
    margin: 20px 30px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.95rem;
    transition: all 0.3s;
    font-family: 'Gilroy', system-ui, sans-serif;
    width: calc(100% - 60px);
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: rgba(115, 53, 225, 0.5);
    box-shadow: 0 0 0 4px rgba(115, 53, 225, 0.12);
    background: var(--bg-light);
    color: #ffffff;
}

.country-list {
    padding: 0 30px 30px;
    overflow-y: auto;
    flex: 1;
}

.country-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-light);
}

.country-card-row:hover {
    background: rgba(115, 53, 225, 0.08);
    border-color: rgba(115, 53, 225, 0.35);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.country-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flag-icon-sm {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.country-name {
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text-primary);
}

.country-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    background: rgba(115, 53, 225, 0.12);
    color: #a78bfa;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(115, 53, 225, 0.2);
}

.price-tag {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a78bfa;
}

.btn-buy-sm {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(115, 53, 225, 0.3);
    font-family: 'Gilroy', system-ui, sans-serif;
}

.btn-buy-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(115, 53, 225, 0.45);
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(19, 18, 33, 0.97);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(115, 53, 225, 0.15);
    border-top: 3px solid #7335e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== STATES ===== */
.error-state,
.empty-state,
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .close-sidebar-btn {
        display: block;
    }

    .hamburger-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .dashboard-header h1 {
        font-size: 1.4rem;
    }

    .stats-container-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .service-card {
        padding: 14px 10px;
        min-height: 110px;
    }

    .service-icon-wrapper {
        width: 38px;
        height: 38px;
    }

    .service-name {
        font-size: 0.73rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .country-list {
        padding: 0 15px 20px;
    }

    .stock-badge {
        display: none;
    }
}