/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;700;800&display=swap');

:root {
    --primary: #007aff;       /* iOS Blue */
    --primary-dark: #0056b3;
    --primary-light: #e5f1ff;
    --secondary: #1d1d1f;     /* iOS Dark Text */
    --text-main: #333336;
    --text-muted: #86868b;
    --bg-main: #f5f5f7;       /* iOS Light Gray */
    --bg-white: #ffffff;
    --border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
    --radius: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #eef2f5;
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Background Orbs */
.orb-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: #cce0ff; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 450px; height: 450px; background: #dcfce7; top: 10%; right: -100px; animation-delay: -2s; }
.orb-3 { width: 600px; height: 600px; background: #f3e8ff; bottom: -200px; left: 15%; animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-white {
    background-color: rgba(255,255,255,0.9);
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}
.btn-white:hover {
    background-color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary);
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-outline:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Glass Card Core */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.9);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.8);
    color: var(--primary);
    border: 1px solid rgba(0, 122, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.hero h1 {
    font-size: 56px;
    letter-spacing: -1px;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-btns {
    display: flex; gap: 15px; justify-content: center; margin-bottom: 40px;
}

/* Search Bar */
.search-container {
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    background: rgba(255,255,255,0.9);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,1);
    backdrop-filter: blur(10px);
}
.search-input {
    flex: 1; border: none; background: transparent; padding: 0 20px; font-size: 16px; font-family: 'Inter'; outline: none;
}
.search-btn {
    background: var(--secondary); color: white; padding: 12px 24px; border-radius: 12px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s;
}
.search-btn:hover { background: #000; }

/* Stats */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 60px auto 0; max-width: 900px;
}
.stat-card { text-align: center; padding: 25px 20px; border-radius: 20px; }
.stat-card h3 { font-size: 32px; color: var(--primary); margin-bottom: 5px; font-weight: 800;}
.stat-card p { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* Articles Grid */
.articles-section { padding: 60px 0 100px; position: relative; z-index: 10; }
.section-title { font-size: 32px; margin-bottom: 10px; text-align: center; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 40px; font-size: 15px;}

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

.article-card {
    display: flex;
    flex-direction: column;
}

.article-card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-img-container {
    padding: 15px;
    padding-bottom: 0;
    position: relative;
}

.article-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    background: white;
}

.article-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.article-title {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.3;
    font-weight: 700;
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex: 1;
    line-height: 1.5;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.article-footer .read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
    color: var(--secondary);
    font-weight: 600;
    transition: 0.2s;
}
.article-card:hover .read-more {
    background: var(--primary-light);
    color: var(--primary);
}

/* Single Article View */
.article-header { padding: 60px 0 40px; text-align: center; position: relative; z-index: 10;}
.article-header h1 { font-size: 42px; margin: 15px auto; max-width: 800px; line-height: 1.3; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 15px; color: var(--text-muted); font-size: 14px; }
.article-cover { width: 100%; max-width: 900px; height: auto; max-height: 500px; object-fit: cover; border-radius: var(--radius); margin: 0 auto 40px; display: block; box-shadow: var(--shadow-md); }
/* Copywriting Typography Rules for Article */
.article-body { 
    max-width: 800px; 
    margin: 0 auto 60px; 
    padding: 50px 60px; 
    font-size: 19px; 
    line-height: 1.8; 
    position: relative; 
    z-index: 10;
    color: #374151; /* Dark gray for better readability */
    font-family: 'Inter', -apple-system, sans-serif;
}
.article-body p:first-of-type {
    font-size: 22px;
    line-height: 1.6;
    color: #1f2937;
    margin-bottom: 2em;
    letter-spacing: -0.01em;
}
.article-body p { margin-bottom: 1.6em; letter-spacing: -0.01em; }
.article-body h2, .article-body h3 {
    color: #111827;
    font-weight: 700;
    margin-top: 2.2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.article-body h2 { font-size: 28px; }
.article-body h3 { font-size: 24px; }
.article-body b, .article-body strong {
    color: #0f172a;
    font-weight: 600;
}
.article-body img.article-inline-img {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin: 40px auto;
}

/* Telegram CTA Block */
.tg-cta {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 24px;
    padding: 40px;
    margin: 40px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}
.tg-cta::before {
    content: '\f2c6'; font-family: 'Font Awesome 6 Brands'; position: absolute; right: -20px; bottom: -20px; font-size: 140px; color: rgba(0, 122, 255, 0.05);
}

/* Footer */
footer { background-color: var(--secondary); color: #cbd5e1; padding: 40px 0; text-align: center; position: relative; z-index: 10;}
footer .logo { color: white; justify-content: center; margin-bottom: 15px; }

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Admin Styles (simplified to keep functional) */
.admin-container { display: flex; min-height: 100vh; position: relative; z-index: 10;}
.sidebar { width: 260px; background: var(--secondary); color: white; padding: 20px 0; }
.sidebar-logo { font-family: 'Outfit'; font-size: 24px; font-weight: 800; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.sidebar-logo span { color: var(--primary); }
.menu-item { padding: 12px 20px; display: block; color: #cbd5e1; transition: all 0.2s; border-left: 4px solid transparent; }
.menu-item:hover, .menu-item.active { background: rgba(255,255,255,0.05); color: white; border-left-color: var(--primary); }
.menu-item i { width: 25px; }
.admin-main { flex: 1; padding: 30px; overflow-y: auto; background: var(--bg-main); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-main); font-size: 14px;}
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; font-family: 'Inter'; background: white;}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
#editor-container { height: 400px; background: white; border-radius: 0 0 12px 12px; font-family: 'Inter', sans-serif; font-size: 16px; }
.ql-toolbar { background: #f8fafc; border-radius: 12px 12px 0 0; }
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table th { background: #f8fafc; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 12px; }
.data-table tr:hover { background: #f8fafc; }
.action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); margin-right: 10px; font-size: 16px; transition: color 0.2s;}
.action-btn:hover { color: var(--primary); }
.action-btn.delete:hover { color: #ef4444; }

@media (max-width: 768px) {
    /* Hero Section */
    .hero { padding: 40px 0 30px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 15px; margin-bottom: 20px;}
    .hero-btns { flex-direction: column; width: 100%; margin: 0 auto 20px; }
    .hero-btns .btn { width: 100%; }
    
    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 30px;}
    .stat-card { padding: 15px; }
    .stat-card h3 { font-size: 24px; }
    
    /* Search */
    .search-container { flex-direction: row; background: rgba(255,255,255,0.9); border-radius: 100px; padding: 5px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid white;}
    .search-input { padding: 12px 15px; margin-bottom: 0; border: none; font-size: 15px; background: transparent; }
    .search-btn { width: auto; padding: 10px 20px; border-radius: 100px; background: var(--primary); color: white;}

    /* Article Card Layout (Horizontal List for Mobile) */
    .articles-grid { display: flex; flex-direction: column; gap: 15px; }
    .article-card { border-radius: 20px; }
    .article-card > a { flex-direction: row; align-items: center; padding: 12px; }
    .article-img-container { width: 80px; height: 80px; padding: 0; flex-shrink: 0; }
    .article-img { width: 100%; height: 100%; border-radius: 16px; box-shadow: none; }
    .article-content { padding: 0 10px 0 15px; }
    .article-category { font-size: 10px; margin-bottom: 4px; }
    .article-title { font-size: 16px; margin-bottom: 4px; line-height: 1.2;}
    .article-excerpt { display: none; } /* Hide excerpt on mobile */
    .article-footer { font-size: 11px; }
    .article-footer .read-more { display: none; } /* Hide read more button, add arrow instead */
    .article-card > a::after { content: '\f054'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: #cbd5e1; font-size: 14px; margin-left: auto; padding-right: 5px;}
    
    /* Single Article View - IDEAL READING */
    .article-header { padding: 30px 0 20px; }
    .article-header h1 { font-size: 26px; }
    .article-meta { flex-direction: column; gap: 5px; }
    
    /* Optimize Padding for Reading */
    .article-body { padding: 30px 20px; font-size: 17px; line-height: 1.7; margin-bottom: 80px;}
    .article-body p:first-of-type { font-size: 19px; margin-bottom: 1.5em; }
    .article-body p { margin-bottom: 1.4em; }
    .article-body h2 { font-size: 24px; margin-top: 2em; margin-bottom: 0.8em; }
    .article-body h3 { font-size: 20px; margin-top: 1.8em; margin-bottom: 0.8em; }
    .article-body img.article-inline-img { margin: 25px 0; border-radius: 12px; }
    
    /* CTA */
    .tg-cta { padding: 25px 15px; margin: 30px 0; border-radius: 16px;}
    .tg-cta h3 { font-size: 18px; }
    .tg-cta::before { font-size: 80px; right: -10px; bottom: -10px;}
    
    /* Navbar optimization */
    .nav-content { padding: 0 15px; }
    .logo img { height: 35px !important; }
    .navbar .btn-outline { display: none; } /* Hide top right button */
    .hamburger-btn { display: flex !important; }

    /* Bottom Navigation */
    .bottom-nav { display: flex !important; }
    footer { padding-bottom: 80px; } /* Add space for bottom nav */
}

/* Hamburger & Bottom Nav Utilities */
.hamburger-btn { display: none; background: none; border: none; font-size: 24px; color: var(--secondary); cursor: pointer; }
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    justify-content: space-around; align-items: center;
    padding: 10px 0 25px 0; /* Extra padding for iOS home indicator */
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-muted); font-size: 11px; font-weight: 500; transition: 0.2s;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--primary); }

/* Placeholder Gradient */
.img-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    display: flex; align-items: center; justify-content: center;
    border-radius: inherit;
}
.img-placeholder i { font-size: 30px; color: #0ea5e9; opacity: 0.5; }
