/* Logo-inspired Color Theme */
:root {
    --logo-purple: #4a1d6e;      /* Dark purple border */
    --logo-green: #a8d5ba;       /* Light pastel green */
    --logo-red: #dc2626;         /* Red cross */
    --logo-yellow: #fbbf24;      /* Yellow banner */
    --logo-blue: #2563eb;        /* Blue torch base */
    --logo-orange: #f97316;      /* Orange flame */
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-right: 240px; /* Space for vertical sub-nav (200px width + 20px right + 20px gap) */
}

/* Home page - no floating menu, use full width */
body.home-page .container {
    margin-right: auto;
}

/* Home page - reduce section spacing */
body.home-page .section {
    padding: 40px 0;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.logo-container:hover {
    text-decoration: none;
}


.logo-image {
    width: 80px;
    height: auto;
    max-height: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-shield {
    width: 70px;
    height: 85px;
    position: relative;
    background: var(--logo-green);
    border: 5px solid var(--logo-purple);
    border-radius: 5px;
    clip-path: polygon(10% 5%, 50% 0%, 90% 5%, 100% 15%, 100% 80%, 50% 100%, 0% 80%, 0% 15%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Shield Text at Top */
.logo-shield::before {
    content: 'J.N. AIER COLLEGE';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 5px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Red Cross in Center */
.logo-cross {
    width: 4px;
    height: 25px;
    background: var(--logo-red);
    position: relative;
    z-index: 2;
}

.logo-cross::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 4px;
    background: var(--logo-red);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Book to the left of cross */
.logo-book {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 10px;
    background: white;
    border: 1px solid var(--text-dark);
    z-index: 1;
}

.logo-book::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--text-dark);
}

/* Graduation Cap (top right) */
.logo-cap {
    position: absolute;
    right: 10px;
    top: 20px;
    width: 10px;
    height: 6px;
    background: var(--text-dark);
    z-index: 1;
    border-radius: 50% 50% 0 0;
}

.logo-cap::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
    background: var(--text-dark);
}

.logo-cap::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 2px;
    width: 2px;
    height: 4px;
    background: var(--text-dark);
    border-radius: 0 0 50% 50%;
}

/* Torch (bottom right) */
.logo-torch {
    position: absolute;
    right: 12px;
    bottom: 15px;
    width: 8px;
    height: 12px;
    background: var(--logo-blue);
    z-index: 1;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
}

.logo-torch::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 5px;
    background: var(--logo-orange);
    border-radius: 50% 50% 0 0;
}

.logo-torch::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 2px;
    background: white;
    clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
}

.logo-text {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.logo-text h2 {
    color: var(--logo-purple);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-decoration: none;
}

.logo-text .motto {
    font-size: 0.7rem;
    color: var(--text-light);
    font-style: italic;
    text-decoration: none;
}

.logo-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-top: 0.2rem;
    text-decoration: none;
}

.logo-banner .estd {
    font-weight: 600;
    text-decoration: none;
}

.logo-banner .year {
    color: var(--logo-purple);
    font-weight: 700;
    text-decoration: none;
}

.logo-banner .motto {
    text-decoration: none;
}

.logo-container:hover .logo-text h2,
.logo-container:hover .logo-text,
.logo-container:hover .logo-banner,
.logo-container:hover .logo-banner * {
    text-decoration: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 3px solid var(--logo-purple);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--logo-purple);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--logo-purple);
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--logo-purple);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--logo-purple) 0%, #6b21a8 100%);
    color: var(--white);
    margin-top: 90px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 1s ease;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.hero-motto {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--logo-yellow);
    font-weight: 600;
    font-style: italic;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--logo-red);
    color: var(--white);
}

.btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--logo-purple);
}

.btn-yellow {
    background: var(--logo-yellow);
    color: var(--text-dark);
}

.btn-yellow:hover {
    background: #f59e0b;
    transform: translateY(-2px);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--logo-purple) 0%, #6b21a8 100%);
    color: var(--white);
    padding: 120px 0 60px;
    margin-top: 90px;
    text-align: center;
    width: 100%;
}

.page-header .container {
    margin-right: auto; /* Override container margin-right to center based on full width */
    max-width: 1200px;
    margin-left: auto;
    padding: 0 20px;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Section Styles */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: .7rem;
    color: var(--logo-purple);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--logo-red);
}

.section-subtitle {
    font-size: 1.8rem;
    color: var(--logo-purple);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--logo-green);
    width: 100%;
    display: block;
}

/* Content Cards */
.content-card {
    background: var(--white);
    border-radius: 10px;
    padding: .7rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--logo-purple);
    transition: all 0.3s ease;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.content-card h3 {
    color: var(--logo-purple);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

/* Three Column Layout */
.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

/* Four Column Layout */
.four-column {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Tabs/Navigation for Sub-sections */
.sub-nav {
    position: fixed;
    top: 130px;
    right: 20px;
    width: 200px;
    background: var(--white);
    padding: 1.5rem 0;
    border: 2px solid var(--logo-green);
    border-radius: 10px;
    z-index: 999;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
}

.sub-nav .container {
    padding: 0;
}

.sub-nav-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    width: 100%;
}

.sub-nav-list li {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sub-nav-link {
    text-decoration: none;
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
    width: auto;
    min-width: fit-content;
    border: 1px solid transparent;
    text-align: left;
    font-size: 0.9rem;
    box-sizing: border-box;
    margin: 0;
    white-space: nowrap;
}

.sub-nav-link:hover {
    background: var(--logo-green);
    color: var(--logo-purple);
    border-color: var(--logo-purple);
    transform: translateX(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sub-nav-link.active {
    background: var(--logo-purple);
    color: var(--white);
    border-color: var(--logo-purple);
    box-shadow: 0 2px 6px rgba(74, 29, 110, 0.3);
}

/* Accordion for Sub-sections */
.accordion-item {
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.accordion-header {
    background: var(--logo-purple);
    color: var(--white);
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: #5b2a8f;
}

.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.accordion-header.active::after {
    content: '−';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 2000px;
}

.accordion-body {
    padding: 1.5rem;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th {
    background: var(--logo-purple);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tr:hover {
    background: var(--logo-green);
    opacity: 0.3;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--logo-green), var(--logo-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

/* Image Popup Modal */
.image-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.image-popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    line-height: 1;
    padding: 0;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    line-height: 1;
    padding: 0;
    user-select: none;
}

.popup-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.popup-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.popup-prev {
    left: 20px;
}

.popup-next {
    right: 20px;
}

.popup-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments for gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .popup-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .popup-close {
        top: -35px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .popup-nav {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    
    .popup-prev {
        left: 10px;
    }
    
    .popup-next {
        right: 10px;
    }
}

/* Stats/Numbers */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--logo-red);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--logo-purple);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--logo-purple);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--logo-yellow);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #d1d5db;
}

.footer-bottom .developer-link {
    color: var(--logo-yellow);
    text-decoration: none;
    font-weight: 600;
    font-style: italic;
    transition: color 0.3s ease;
}

.footer-bottom .developer-link:hover {
    color: var(--white);
    text-decoration: none;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 90px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        border-bottom: 3px solid var(--logo-purple);
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .two-column,
    .three-column,
    .four-column {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .sub-nav {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        max-height: none;
        margin-bottom: 1rem;
        border: none;
        border-bottom: 2px solid var(--logo-green);
        border-radius: 0;
    }

    .container {
        margin-right: auto;
        padding-right: 20px;
    }

    .page-header {
        padding-right: 0;
    }

    .section {
        margin-right: 0;
    }

    .sub-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
    }

    .sub-nav-link {
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .sub-nav-link:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .logo-text h2 {
        font-size: 1.2rem;
    }

    .logo-shield {
        width: 50px;
        height: 60px;
    }
}

/* Collapsible Panel Styles */
details summary::-webkit-details-marker {
    display: none;
}

details[open] summary span:last-child {
    transform: rotate(180deg);
}

details summary {
    user-select: none;
}

details summary:hover {
    background: #e9ecef !important;
}
