/* MobiGrok Frontend CSS */

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #f39c12;
    --text-color: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --white: #ffffff;
    --black: #000000;
    --success: #28a745;
    --danger: #dc3545;
    --max-width: 1200px;
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-color: #ecf0f1;
    --text-light: #bdc3c7;
    --bg-light: #1a1a1a;
    --white: #2c2c2c;
    --border-color: #3a3a3a;
    --black: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background: var(--bg-light);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-nav {
    position: relative;
    z-index: 1001;
}

.header-top {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Logo */
.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 3s ease-in-out infinite;
    cursor: pointer;
    display: inline-block;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.8)); }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle, .dark-mode-toggle, .notification-btn, .login-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-toggle:hover, .dark-mode-toggle:hover, .notification-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1);
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Search Bar */
.search-container {
    display: none;
    padding: 20px 0;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.search-container.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.voice-search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.voice-search-btn:hover {
    background: var(--primary-dark);
}

.voice-search-btn.listening {
    background: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Navigation */
.main-nav {
    background: var(--white);
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

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

.nav-link:hover::before {
    width: 80%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Breaking News - Completely Redesigned */
.breaking-news {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 900;
    height: 45px;
}

.breaking-news-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    position: relative;
    height: 45px;
    overflow: hidden;
}

.breaking-label {
    font-weight: 800;
    text-transform: uppercase;
    background: #8b0000;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    border-right: 2px solid #000000;
    box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4);
    height: 100%;
    z-index: 2;
}

.breaking-label i {
    margin-right: 5px;
    font-size: 10px;
    animation: flash 1.5s ease-in-out infinite;
}

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

.breaking-news-content {
    display: flex;
    align-items: center;
    animation: scroll 25s linear infinite;
    padding: 0 20px;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.breaking-news-content:hover {
    animation-play-state: paused;
}

.breaking-item {
    white-space: nowrap;
    margin-right: 60px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.breaking-item a,
a.breaking-item {
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 6px;
}

.breaking-item a:hover,
a.breaking-item:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Mobile Breaking News */
@media (max-width: 768px) {
    .breaking-news {
        margin-top: 0;
        position: relative;
        z-index: 900;
        height: 40px;
    }
    
    .breaking-news-wrapper {
        height: 40px;
        grid-template-columns: 75px 1fr;
        overflow: hidden;
    }
    
    .breaking-label {
        padding: 0 8px;
        font-size: 8px;
        letter-spacing: 0.5px;
        background: #8b0000;
        height: 100%;
    }
    
    .breaking-label i {
        margin-right: 3px;
        font-size: 9px;
    }
    
    .breaking-item {
        font-size: 12px;
        margin-right: 35px;
    }
    
    .breaking-item a,
    a.breaking-item {
        padding: 5px 10px;
    }
    
    .breaking-news-content {
        animation: scroll 25s linear infinite;
        padding: 0 10px;
        height: 100%;
        overflow: hidden;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .mobile-menu-toggle {
        display: block;
        font-size: 20px;
        padding: 5px;
    }
}

/* Hero Section */
.hero-section {
    background: var(--white);
    padding: 40px 0;
    margin-bottom: 40px;
}

.hero-slider {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.hero-slide {
    display: none;
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 40px;
    color: white;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-excerpt {
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.hero-category {
    display: inline-block;
    background: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.slider-btn {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: rgba(255,255,255,0.5);
}

/* Section */
.section {
    margin-bottom: 50px;
}

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

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 2px;
}

.view-all-link {
    color: var(--primary-color);
    font-weight: 600;
    transition: opacity 0.3s;
}

.view-all-link:hover {
    opacity: 0.7;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
}

.card-date, .card-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
}

.newsletter-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-left-section {
        gap: 12px;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        gap: 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-link {
        border-bottom: 1px solid var(--border-color);
        padding: 15px 20px;
    }
    
    .nav-link::before {
        display: none;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .login-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .search-toggle, .dark-mode-toggle, .notification-btn {
        font-size: 18px;
        padding: 6px 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    margin-bottom: 20px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    color: var(--text-light);
    font-size: 18px;
}

.breadcrumb a {
    color: var(--primary-color);
    transition: opacity 0.3s;
}

.breadcrumb a:hover {
    opacity: 0.7;
}

.breadcrumb span {
    color: var(--text-light);
}

/* Lazy Load */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

