/* 
 * News Portal Custom Styles
 * Styling tambahan untuk portal berita FitMotor
 */

/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== TYPOGRAPHY ===== */
.news-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

.news-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gray-700);
}

.news-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-600);
}

.news-meta {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ===== LAYOUT COMPONENTS ===== */

/* Header Enhancements */
.news-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.news-logo {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    box-shadow: var(--shadow);
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

/* ===== CARD COMPONENTS ===== */

/* Main Article Card */
.hero-article {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.8s ease-out;
}

.hero-article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Article Cards */
.article-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

/* Image Enhancements */
.article-image {
    position: relative;
    overflow: hidden;
}

.article-image img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Image Overlay */
.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .image-overlay {
    opacity: 1;
}

/* ===== BADGES & LABELS ===== */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.badge-technology {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.badge-business {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-sports {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-health {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.badge-entertainment {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.badge-general {
    background: linear-gradient(135deg, var(--gray-600), var(--gray-700));
    color: white;
}

/* Reading Time Badge */
.reading-time {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #2563eb);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

/* Load More Button */
.load-more-btn {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===== SEARCH COMPONENTS ===== */
.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pagination-item:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.pagination-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

/* ===== LOADING STATES ===== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ALERTS & NOTIFICATIONS ===== */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
}

/* ===== RESPONSIVE UTILITIES ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .hero-article {
        margin-bottom: 2rem;
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .article-card {
        border-radius: 8px;
    }
    
    .btn-primary,
    .load-more-btn {
        width: 100%;
        text-align: center;
    }
    
    .category-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.article-card:focus,
.btn-primary:focus,
.search-input:focus,
.pagination-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .news-header,
    .pagination,
    .load-more-btn,
    .search-container {
        display: none;
    }
    
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .article-card:hover {
        transform: none;
    }
}
