/* ========================================= */
/* === 1. VARIABLES & RESET === */
/* ========================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,400&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* THEME: Civil Appellate High Court (Maroon & Gold) */
    --primary-color: #660000;   /* Deep Maroon - The main identity color */
    --secondary-color: #800000; /* Lighter Maroon - For hover states */
    --gold-accent: #d4af37;     /* Judicial Gold - For accents and highlights */
    
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-grey: #666666;
    
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    
    --shadow-soft: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-hard: 0 10px 30px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* ========================================= */
/* === 2. HEADER & NAVIGATION === */
/* ========================================= */

header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(102, 0, 0, 0.95); /* Maroon Transparent */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.4s ease;
}

/* Sticky Header State */
header.sticky {
    background: #ffffffee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 10px 40px;
    border-bottom: none;
}

header.sticky .court-name { color: #000; }
header.sticky .court-sub, header.sticky .court-loc { color: #555; }
header.sticky nav ul li a { color: #333; }
header.sticky .header-icons { color: #333; }
header.sticky .logo-container img { height: 55px; }

/* Logo Area */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container img {
    height: 65px;
    transition: height 0.3s;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.court-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.court-sub { font-size: 0.65rem; color: #eeeeee; letter-spacing: 0.5px; }
.court-loc { font-size: 0.6rem; color: #cccccc; margin-top: 2px; }

.logo-divider {
    width: 40px; height: 2px;
    background-color: var(--gold-accent);
    margin-top: 5px; display: block;
}

/* Navigation Menu */
.nav-wrapper { display: flex; align-items: center; gap: 30px; }

nav ul { display: flex; gap: 20px; }

nav ul li a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--gold-accent) !important;
}

nav ul li a.active::after {
    content: '';
    position: absolute; width: 100%; height: 3px;
    background: var(--gold-accent);
    bottom: -5px; left: 0;
}

nav ul li a i { font-size: 0.7rem; margin-left: 3px; vertical-align: middle; }

.header-icons {
    display: flex; gap: 20px;
    color: var(--text-light);
    font-size: 1.2rem; cursor: pointer;
}

/* Dropdown Menu */
.dropdown { position: relative; padding-bottom: 15px; margin-bottom: -15px; }

.dropdown-content {
    position: absolute;
    top: 100%; left: 0;
    background-color: #ffffff;
    min-width: 260px;
    box-shadow: var(--shadow-hard);
    border-top: 3px solid var(--gold-accent);
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex; flex-direction: column;
    padding: 10px 0;
    z-index: 9999;
}

.dropdown:hover .dropdown-content {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown-content li a {
    color: #444 !important;
    padding: 12px 25px;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: none;
    border-bottom: 1px solid #f5f5f5;
}

.dropdown-content li a:after { display: none; } /* No underline for dropdown items */

.dropdown-content li a:hover {
    background-color: #f9f9f9;
    color: var(--primary-color) !important;
    padding-left: 30px;
    border-left: 3px solid var(--gold-accent);
}

/* ========================================= */
/* === 3. SIDEBAR === */
/* ========================================= */

.sidebar {
    position: fixed;
    top: 0; right: -450px;
    width: 400px; height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    z-index: 2000;
    padding: 40px;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    overflow-y: auto;
}

.sidebar.active { right: 0; }

.close-btn {
    position: absolute; top: 20px; right: 30px;
    font-size: 2rem; cursor: pointer; color: #333;
    transition: 0.3s;
}

.close-btn:hover { color: var(--primary-color); transform: rotate(90deg); }

.sidebar h3 {
    font-size: 1.5rem; color: #000;
    margin-bottom: 25px; margin-top: 40px;
    font-weight: 700;
    border-bottom: 3px solid var(--gold-accent);
    display: inline-block; padding-bottom: 5px;
}

.sidebar-post { margin-bottom: 20px; }
.sidebar-post a { font-weight: 600; font-size: 1rem; color: #333; }
.sidebar-post a:hover { color: var(--primary-color); }

.contact-item { display: flex; gap: 15px; margin-bottom: 20px; color: #444; }
.contact-item i { color: #000; font-size: 1.1rem; margin-top: 3px; }

.social-links { display: flex; gap: 15px; }
.social-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; transition: transform 0.3s;
}
.social-btn:hover { transform: translateY(-3px); }
.fb { background: #3b5998; } .tw { background: #1da1f2; }

/* ========================================= */
/* === 4. HERO SECTIONS === */
/* ========================================= */

/* Home Hero */
.hero {
    position: relative; height: 85vh;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
}

.hero-slideshow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.5s ease-in-out;
}
.slide.active { opacity: 1; transform: scale(1.05); transition: opacity 1.5s, transform 6s linear; }

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(51, 0, 0, 0.5), rgba(51, 0, 0, 0.3)); /* Maroon Overlay */
    z-index: 2;
}

.hero-content {
    position: relative; z-index: 3;
    text-align: center; color: white; padding: 0 20px;
}

.hero-content h2 { font-size: 3.5rem; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 30px; }

/* Subpage Hero */
.page-hero {
    /* Gradient handled inline in PHP usually, or default here */
    background-color: var(--primary-color);
    height: 45vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
    margin-top: 80px; /* Offset for fixed header */
}

.page-hero h1 { font-size: 3rem; margin-bottom: 10px; text-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.page-hero p { font-size: 1.1rem; opacity: 0.9; }

/* ========================================= */
/* === 5. BUTTONS & UTILITIES === */
/* ========================================= */

.btn-gold {
    background-color: var(--gold-accent);
    color: #fff;
    padding: 12px 30px;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    border: 2px solid var(--gold-accent);
}

.btn-gold:hover {
    background-color: transparent;
    color: white; /* If on dark bg */
}
/* If button is on white bg */
.filter-container .btn-gold:hover { color: var(--gold-accent); }

.btn-black {
    background: #333; color: white;
    padding: 10px 20px; border-radius: 4px;
    font-size: 0.85rem; display: inline-block;
}
.btn-black:hover { background: var(--primary-color); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Animations */
.reveal {
    opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out;
}
.reveal.active { opacity: 1; transform: translateY(0); }

.hover-scale { transition: transform 0.3s; display: block; }
.hover-scale:hover { transform: scale(1.02); }

/* ========================================= */
/* === 6. CARDS (SERVICES & NEWS) === */
/* ========================================= */

.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; padding: 50px 8%; margin-top: -60px; position: relative; z-index: 10;
}

.card {
    background: white; padding: 35px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: transform 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-10px);
    border-top-color: var(--gold-accent);
    box-shadow: var(--shadow-hard);
}

.card i { margin-bottom: 15px; color: var(--primary-color); }
.card h3 { margin-bottom: 10px; color: #333; }
.card p { font-size: 0.9rem; color: #666; }

/* News Cards (news_notices.php) */
.news-item-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #eee;
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 250px;
    transition: transform 0.3s;
}

.news-item-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hard); }

.news-meta {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: #888; margin-bottom: 15px;
}

.news-title { font-size: 1.3rem; margin-bottom: 10px; color: var(--primary-color); }

/* ========================================= */
/* === 7. TABLES & FORMS === */
/* ========================================= */

/* Tables */
.custom-table {
    width: 100%; border-collapse: collapse;
    background: white; box-shadow: var(--shadow-soft);
    margin-top: 20px;
}

.custom-table th {
    background-color: var(--primary-color);
    color: white; padding: 15px;
    text-align: left; font-weight: 500; text-transform: uppercase; font-size: 0.9rem;
}

.custom-table td {
    padding: 15px; border-bottom: 1px solid #eee;
    color: #444; font-size: 0.95rem;
}

.custom-table tr:hover { background-color: #f9f9f9; }

.btn-download {
    display: inline-block; padding: 6px 12px;
    border-radius: 4px; font-size: 0.8rem;
}

/* Forms */
.form-control {
    width: 100%; padding: 12px;
    border: 1px solid #ccc; border-radius: 4px;
    font-family: inherit; font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(102, 0, 0, 0.2);
}

.filter-container {
    background: #fcfcfc; padding: 25px;
    border-radius: 8px; border: 1px solid #eee;
}

/* ========================================= */
/* === 8. SPECIFIC PAGE STYLES === */
/* ========================================= */

/* Speeches Page */
.speech-container { background: #fff; padding: 40px; }
.speech-title { font-family: 'Playfair Display', serif; }
.speech-body blockquote {
    border-left: 4px solid var(--gold-accent);
    padding: 20px; background: #f9f9f9;
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; font-style: italic;
    margin: 30px 0;
}

/* Past Judges Page */
.past-judges-container ul { column-count: 2; column-gap: 50px; }
.past-judges-container li { margin-bottom: 15px; break-inside: avoid; }

/* Live Cases Page */
.live-header { background: var(--primary-color); color: white; padding: 30px; text-align: center; }

/* ========================================= */
/* === 9. FOOTER === */
/* ========================================= */

footer {
    background-color: var(--primary-color);
    color: #ccc;
    padding: 70px 8% 20px;
    margin-top: 50px;
    border-top: 5px solid var(--gold-accent);
}

.footer-container {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px; margin-bottom: 40px;
}

.footer-col h3 { color: var(--gold-accent); margin-bottom: 25px; font-size: 1.1rem; text-transform: uppercase; }

.footer-col a {
    display: block; color: #ddd; margin-bottom: 12px; font-size: 0.9rem;
}
.footer-col a:hover { color: var(--gold-accent); padding-left: 5px; }

.copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center; padding-top: 20px; font-size: 0.85rem;
}

.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--gold-accent); color: var(--primary-color);
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: var(--shadow-hard);
}

/* ========================================= */
/* === 10. RESPONSIVE === */
/* ========================================= */

@media screen and (max-width: 768px) {
    header { flex-direction: column; padding: 15px; background: var(--primary-color); }
    .logo-container { flex-direction: column; text-align: center; margin-bottom: 15px; }
    
    .nav-wrapper { width: 100%; justify-content: center; }
    nav ul { display: none; } /* Use JS for mobile menu toggle normally, kept simple here */
    
    .hero { height: 60vh; }
    .hero-content h2 { font-size: 2rem; }
    
    .services-grid { padding: 30px 5%; margin-top: 0; }
    
    .past-judges-container ul { column-count: 1; }
    
    .sidebar { width: 100%; right: -100%; }
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Roboto:wght@300;400;500&display=swap');

:root {
    /* THEME CHANGE: Civil Appellate High Court (Maroon & Gold) */
    --primary-color: #660000; /* Deep Maroon - Authoritative & Traditional */
    --secondary-color: #800000; /* Slightly lighter Maroon for gradients/hovers */
    
    /* Gold remains to signify the Judiciary */
    --gold-accent: #d4af37; 
    
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-light: #f9f9f9;
    
    --shadow-soft: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-hard: 0 10px 30px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

/* --- HEADER --- */
header {
    position: fixed; 
    top: 0; left: 0; width: 100%;
    padding: 15px 40px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000;
    background: rgba(102, 0, 0, 0.95); /* Maroon Transparent */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.4s ease;
}

header.sticky {
    background: #ffffffee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 10px 40px;
    border-bottom: none;
}
header.sticky .court-name { color: #000; }
header.sticky .court-sub, header.sticky .court-loc { color: #555; }
header.sticky nav ul li a, header.sticky .header-icons { color: #333; }
header.sticky .logo-container img { height: 55px; }

/* --- LOGO & NAV --- */
.logo-container { display: flex; align-items: center; gap: 15px; }
.logo-container img { height: 65px; transition: height 0.3s; }
.logo-text { display: flex; flex-direction: column; }
.court-name {
    font-size: 1.4rem; font-weight: 700; color: #fff;
    text-transform: uppercase; line-height: 1.1; letter-spacing: 0.5px;
}
.court-sub { font-size: 0.65rem; color: #eee; }
.court-loc { font-size: 0.6rem; color: #ccc; margin-top: 2px; }
.logo-divider { width: 40px; height: 2px; background: var(--gold-accent); margin-top: 5px; }

.nav-wrapper { display: flex; gap: 30px; }
nav ul { display: flex; list-style: none; gap: 20px; }
nav ul li a {
    text-decoration: none; font-size: 0.9rem; font-weight: 600;
    color: #fff; text-transform: uppercase; position: relative; padding-bottom: 5px;
}
nav ul li a.active::after {
    content: ''; position: absolute; width: 100%; height: 3px;
    background: var(--gold-accent); bottom: -5px; left: 0;
}
.header-icons { display: flex; gap: 20px; color: #fff; font-size: 1.2rem; cursor: pointer; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-content {
    position: absolute; top: 100%; left: 0;
    background: #fff; min-width: 260px;
    box-shadow: var(--shadow-hard); border-top: 3px solid var(--gold-accent);
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s ease; padding: 10px 0; z-index: 9999;
}
.dropdown:hover .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-content li a {
    color: #444 !important; padding: 12px 25px; display: block;
    border-bottom: 1px solid #f5f5f5; text-transform: none;
}
.dropdown-content li a:hover {
    background: #f9f9f9; color: var(--primary-color) !important;
    border-left: 3px solid var(--gold-accent); padding-left: 30px;
}

/* --- HERO --- */
.hero {
    position: relative; height: 85vh; display: flex;
    justify-content: center; align-items: center; overflow: hidden;
}
.hero-slideshow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.5s ease;
}
.slide.active { opacity: 1; transform: scale(1.05); transition: opacity 1.5s, transform 6s linear; }
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(51, 0, 0, 0.5), rgba(51, 0, 0, 0.3)); /* Maroon Overlay */
    z-index: 2;
}
.hero-content { position: relative; z-index: 3; text-align: center; color: white; padding: 0 20px; }
.hero-content h2 { font-size: 3.5rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.btn-gold {
    background: var(--gold-accent); color: #fff; padding: 12px 30px;
    text-decoration: none; font-weight: bold; border-radius: 4px; border: 2px solid var(--gold-accent);
}
.btn-gold:hover { background: transparent; color: #fff; }

/* --- SECTIONS --- */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; padding: 50px 8%; margin-top: -60px; position: relative; z-index: 10;
}
.card {
    background: white; padding: 35px; border-radius: 8px; box-shadow: var(--shadow-soft);
    text-align: center; border-top: 4px solid var(--primary-color); transition: 0.3s;
}
.card:hover { transform: translateY(-10px); border-top-color: var(--gold-accent); box-shadow: var(--shadow-hard); }
.card i { color: var(--primary-color); margin-bottom: 15px; }

/* Footer */
footer {
    background: var(--primary-color); color: #ccc; padding: 60px 8% 20px;
    margin-top: 50px; border-top: 5px solid var(--gold-accent);
}
.footer-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.footer-col h3 { color: var(--gold-accent); margin-bottom: 20px; }
.footer-col a { color: #ddd; display: block; margin-bottom: 10px; }
.footer-col a:hover { color: var(--gold-accent); padding-left: 5px; }
.copyright { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; }

/* Utilities */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.page-hero {
    height: 45vh; display: flex; align-items: center; justify-content: center;
    text-align: center; color: white; margin-top: 80px;
    background-size: cover; background-position: center;
}
/* Responsive */
@media(max-width: 768px){
    header { flex-direction: column; background: var(--primary-color); padding: 15px; }
    .nav-wrapper, nav ul { flex-direction: column; width: 100%; display: none; } /* Simplified mobile */
    .hero-content h2 { font-size: 2rem; }
    .services-grid { margin-top: 0; }
}
