/* 
 * News Portal Color Scheme
 * Professional news website design inspired by BBC & NYTimes
 */

:root {
    /* Primary Colors */
    --primary: #0A2540;           /* Deep Blue - Credibility, stability */
    --primary-light: #1a3a5c;     /* Lighter variation */
    --primary-dark: #051429;      /* Darker variation */
    
    /* Secondary & Accent Colors */
    --secondary: #D72638;         /* Crimson Red - Headlines, highlights */
    --accent: #FFB703;            /* Golden Yellow - Buttons, labels */
    
    /* Background Colors */
    --bg-light: #F8F9FA;          /* Light Gray - Main background */
    --bg-white: #FFFFFF;          /* Pure white */
    
    /* Text Colors */
    --text-primary: #1A1A1A;      /* Almost Black - Main text */
    --text-secondary: #6C757D;    /* Medium Gray - Metadata, timestamps */
    
    /* Interactive Colors */
    --link: #0077B6;              /* Bright Blue - Links */
    --link-hover: #005a8c;        /* Darker blue for hover */
    
    /* Status Colors */
    --success: #2ECC71;           /* Green - Validation indicators */
    --warning: #FFC107;           /* Amber - Warnings */
    --danger: #DC3545;            /* Red - Errors */
    --info: #17A2B8;              /* Cyan - Information */
}

/* Body & General Styles */
body {
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
}

* {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, span, a, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Navigation Bar */
.nav-gradient {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-gradient a {
    color: var(--bg-white);
    transition: color 0.3s ease;
}

.nav-gradient a:hover {
    color: var(--accent);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215, 38, 56, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--bg-white);
    border: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 37, 64, 0.3);
}

.btn-accent {
    background: var(--accent);
    color: var(--primary);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background: #e6a600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--bg-white);
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.card * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(10, 37, 64, 0.1);
    box-shadow: 0 8px 32px rgba(10, 37, 64, 0.1);
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

/* Category Badges */
.badge-category {
    background: var(--accent);
    color: var(--primary);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* Status Badges */
.badge-pending {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFE69C;
}

.badge-approved {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.badge-archived {
    background: #E2E3E5;
    color: #383D41;
    border: 1px solid #D6D8DB;
}

.badge-admin {
    background: #CCE5FF;
    color: #004085;
    border: 1px solid #B8DAFF;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
}

/* Headlines */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

.headline-primary {
    color: var(--primary);
}

.headline-accent {
    color: var(--secondary);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
    background: var(--bg-white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

/* Tables */
table {
    background: var(--bg-white);
    table-layout: fixed;
    width: 100%;
}

thead {
    background: var(--bg-light);
}

thead th {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

tbody tr {
    border-bottom: 1px solid #E9ECEF;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: #F8F9FA;
}

tbody td {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

/* Footer */
footer {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    color: var(--bg-white);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

footer a {
    color: #B8C5D6;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent);
}

footer h3 {
    color: var(--accent);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid var(--success);
}

.alert-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid var(--secondary);
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid var(--warning);
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
    border: 1px solid var(--info);
}

/* Statistics Cards */
.stat-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card-primary {
    border-top: 4px solid var(--primary);
}

.stat-card-secondary {
    border-top: 4px solid var(--secondary);
}

.stat-card-accent {
    border-top: 4px solid var(--accent);
}

.stat-card-success {
    border-top: 4px solid var(--success);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pagination */
.pagination a {
    border: 2px solid var(--primary);
    color: var(--primary);
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.pagination a.active {
    background: var(--secondary);
    color: var(--bg-white);
    border-color: var(--secondary);
}

/* News Article Styles */
.article-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.article-meta svg {
    color: var(--link);
}

.article-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.125rem;
}

/* Breadcrumbs */
.breadcrumb {
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--link);
}

.breadcrumb a:hover {
    color: var(--link-hover);
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* Utility Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-accent { background-color: var(--accent); }
.bg-light { background-color: var(--bg-light); }
.border-primary { border-color: var(--primary); }
.border-secondary { border-color: var(--secondary); }
.border-accent { border-color: var(--accent); }

/* Text Truncation and Line Clamping */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Ensure line-clamp works with anchor tags */
a.line-clamp-1,
a.line-clamp-2,
a.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Table cell text wrapping */
.break-words {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.max-w-xs {
    max-width: 20rem;
}

.max-w-sm {
    max-width: 24rem;
}

.max-w-md {
    max-width: 28rem;
}

/* Mobile Menu */
#mobile-menu a {
    color: var(--bg-white);
    padding: 0.75rem 0;
    display: block;
    transition: color 0.3s ease;
}

#mobile-menu a:hover {
    color: var(--accent);
}

/* Active navigation link */
.nav-gradient a.active, .nav-gradient a[aria-current="page"] {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
}

/* Mobile menu background and focus */
#mobile-menu {
    background: linear-gradient(180deg, rgba(10,37,64,0.95), rgba(10,37,64,0.98));
    padding: 1rem;
}

#mobile-menu a:focus {
    outline: 3px solid rgba(255, 183, 3, 0.25);
    outline-offset: 2px;
}

/* Glass Effect */
.glass-effect {
    background: rgba(10, 37, 64, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
}
