/* ===== TELEGRAM MINI APP STYLES ===== */
:root {
    --tg-theme-bg-color: #0a0a0a;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #888888;
    --tg-theme-link-color: #27AE60;
    --tg-theme-button-color: #27AE60;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #1a1a1a;
    --primary-green: #27AE60;
    --dark-green: #219653;
    --light-green: #6FCF97;
    --gold-color: #FFD700;
    --premium-color: #9B59B6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

/* Telegram-like Header */
.tg-header {
    background: var(--tg-theme-secondary-bg-color);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.tg-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tg-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tg-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 800;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tg-header-info h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin-bottom: 4px;
}

.tg-header-info p {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tg-status {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.tg-content {
    padding: 20px;
    padding-bottom: 80px;
    max-width: 500px;
    margin: 0 auto;
}

/* Welcome Banner */
.tg-welcome-banner {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(155, 89, 182, 0.15));
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.tg-welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(39, 174, 96, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.tg-welcome-content {
    position: relative;
    z-index: 1;
}

.tg-welcome-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tg-welcome-text {
    color: var(--tg-theme-hint-color);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Quick Actions */
.tg-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.tg-action-btn {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tg-action-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-green);
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.2);
}

.tg-action-icon {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary-green);
}

.tg-action-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

/* Agencies Section */
.tg-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tg-section-title i {
    color: var(--primary-green);
}

.tg-agencies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.tg-agency-card {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tg-agency-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-green);
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.2);
}

.tg-agency-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--gold-color);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
}

.tg-agency-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(155, 89, 182, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-green);
}

.tg-agency-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--tg-theme-text-color);
}

.tg-agency-desc {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.tg-agency-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

.tg-status-active {
    background: rgba(39, 174, 96, 0.2);
    color: var(--light-green);
}

.tg-status-premium {
    background: rgba(155, 89, 182, 0.2);
    color: var(--premium-color);
}

/* Premium Section */
.tg-premium-card {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(39, 174, 96, 0.1));
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.tg-premium-icon {
    font-size: 40px;
    color: var(--premium-color);
    margin-bottom: 15px;
}

.tg-premium-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--premium-color);
    margin-bottom: 10px;
}

.tg-premium-text {
    color: var(--tg-theme-hint-color);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.tg-premium-btn {
    background: linear-gradient(135deg, var(--premium-color), #8E44AD);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tg-premium-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

/* Stats Grid */
.tg-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.tg-stat-card {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.tg-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.tg-stat-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

/* Bottom Navigation */
.tg-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
}

.tg-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--tg-theme-hint-color);
    text-decoration: none;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 12px;
    min-width: 60px;
}

.tg-nav-item.active {
    color: var(--primary-green);
    background: rgba(39, 174, 96, 0.1);
}

.tg-nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.tg-nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* Animations */
.tg-fade-in {
    animation: tgFadeIn 0.6s ease;
}

@keyframes tgFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .tg-content {
        padding: 15px;
        padding-bottom: 70px;
    }
    
    .tg-welcome-banner {
        padding: 20px;
    }
    
    .tg-welcome-title {
        font-size: 20px;
    }
    
    .tg-agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .tg-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .tg-stat-card {
        padding: 15px;
    }
    
    .tg-stat-value {
        font-size: 18px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 3px;
}