/* --- CORE RESET & BASICS --- */
body {
    background-color: #111827; /* Dark Gray 900 */
    color: #E5E7EB; /* Gray 200 */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- UTILITIES --- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.text-blue-400 { color: #60A5FA; }
.text-green-400 { color: #34D399; }
.text-gray-400 { color: #9CA3AF; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }
.uppercase { text-transform: uppercase; }
.hover\:underline:hover { text-decoration: underline; }

/* --- NAVIGATION & HEADER --- */
.header-bg { background-color: #1F2937; border-bottom: 1px solid #374151; }
.footer-bg { background-color: #1F2937; border-top: 1px solid #374151; }
.nav-bg { background-color: #1A202C; }

.nav-link {
    padding: 0.5rem 1rem;
    color: #D1D5DB;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}
.nav-link:hover { background-color: #374151; color: #fff; }
.nav-active { color: #60A5FA; background-color: #1F2937; font-weight: 700; }

/* --- CARD SYSTEM (The Business Card Look) --- */
.card, .article-card, .hero-card {
    background-color: #1F2937; /* Gray 800 */
    border: 1px solid #374151; /* Gray 700 */
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Lift Effect on Hover */
.card:hover, .article-card:hover, .hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
    border-color: #4B5563;
}

/* --- IMAGE HANDLING (Force Square) --- */
.article-image-container, .hero-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* FORCE SQUARE RATIO */
    overflow: hidden;
    background-color: #111827;
    position: relative;
    border-bottom: 1px solid #374151;
}

.article-image, .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image fills the square without stretching */
    transition: transform 0.5s ease;
}

.article-card:hover .article-image, .hero-card:hover .hero-image {
    transform: scale(1.1); /* Zoom effect */
}

/* --- STANDARD ARTICLE CARD --- */
.article-card {
    border-top: 4px solid #3B82F6; /* Blue Top Accent */
}

.article-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    background: linear-gradient(to bottom, #1F2937, #1A202C);
}

.article-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    color: #F3F4F6;
}

.article-card p {
    font-size: 0.9rem;
    color: #9CA3AF;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* --- HERO CARD (Top Story) --- */
/* Adjusted to work in a grid (Vertical Stack) */
.hero-card {
    border-top: 4px solid #10B981; /* Green Top Accent */
}

.hero-content-wrapper {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    background: linear-gradient(to bottom, #1F2937, #064E3B); /* Subtle green tint at bottom */
}

.hero-category {
    display: inline-block;
    background-color: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid #059669;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: #fff;
}

/* --- WIDGETS --- */
.widget {
    background-color: #1F2937;
    border: 1px solid #374151;
    border-left: 4px solid #8B5CF6; /* Purple Accent */
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.widget-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #A78BFA;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.4);
}
.widget ul li:last-child { border-bottom: none; }

/* --- FORM ELEMENTS --- */
.form-input {
    background-color: #111827;
    border: 1px solid #4B5563;
    border-radius: 0.375rem;
    color: #E5E7EB;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.btn {
    background-color: #2563EB;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
}
.btn:hover { background-color: #1D4ED8; }

.btn-secondary {
    background-color: #374151;
    color: #D1D5DB;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.375rem;
    border: 1px solid #4B5563;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}
.btn-secondary:hover { background-color: #4B5563; color: white; }

/* --- ADMIN TABLES --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.admin-table th {
    background-color: #374151;
    color: #9CA3AF;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #374151;
    color: #D1D5DB;
}
.admin-table tr:hover { background-color: rgba(55, 65, 81, 0.5); }
.admin-table tr:last-child td { border-bottom: none; }

/* --- STATUS BADGES --- */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.status-approved, .status-enabled, .status-info {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-pending, .status-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.status-rejected, .status-disabled, .status-error, .status-critical {
    background-color: rgba(239, 68, 68, 0.2);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* --- NOTIFICATION BADGE --- */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #EF4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- UTILITIES --- */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.line-clamp-4 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }

@media (max-width: 768px) {
    .homepage-section-title { font-size: 1.25rem; }
    .hero-title { font-size: 1.25rem; }
    .btn, .btn-secondary { width: 100%; margin-bottom: 0.5rem; }
}

main.container > section { margin-bottom: 3rem; }


/* --- AI AGENT CHAT STYLES --- */
.chat-window {
    height: 350px;
    overflow-y: auto;
    padding: 1rem;
    background-color: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.message-agent {
    background-color: #374151;
    color: #E5E7EB;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}
.message-user {
    background-color: #2563EB;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

/* Results embedded in chat */
.chat-result-link {
    display: block;
    background: rgba(0,0,0,0.2);
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    border-left: 3px solid #10B981;
    text-decoration: none;
    color: #A7F3D0;
    font-size: 0.85rem;
}
.chat-result-link:hover { background: rgba(0,0,0,0.4); }

/* Mic Animation */
.mic-active {
    background-color: #EF4444 !important;
    animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
