/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
    /* Colors */
    --primary: #1a365d;
    /* Royal Blue */
    --primary-dark: #102a4e;
    --secondary: #c5a059;
    /* Gold */
    --secondary-light: #e6c888;
    --accent: #2b6cb0;
    --text-dark: #1a202c;
    --text-light: #4a5568;
    --text-white: #ffffff;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --bg-dark: #0f172a;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--text-white);
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-4 {
    margin-bottom: 4rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
    background-color: transparent;
    /* Start transparent */
}

.navbar.scrolled {
    background-color: var(--primary-dark);
    padding: 10px 0;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    color: var(--text-white);
}

/* Mobile Nav */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--primary-dark);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
        padding: 40px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        right: 0;
    }
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--text-white);
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.profile-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.25rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.card-body .role {
    display: block;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Team Card (Circular Image style) */
.team-card {
    text-align: center;
    padding: 30px 20px;
}

.team-card .img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 3px solid var(--secondary);
}

.team-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-card h3 {
    margin-bottom: 5px;
    color: var(--primary);
}

.team-card .role {
    color: var(--text-light);
    font-weight: 500;
}

/* List Group */
.list-group {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item h4 {
    margin-bottom: 2px;
}

/* Basic Accordion */
.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    background: var(--bg-white);
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.accordion-header {
    padding: 20px;
    cursor: pointer;
    background: var(--bg-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.accordion-body {
    display: none;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #eee;
}

.accordion-item.active .accordion-body {
    display: block;
}

.badge {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20%;
    width: 60%;
    height: 3px;
    background-color: var(--secondary);
}

/* Gallery - Masonry attempt with CSS columns */
.gallery-grid {
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    display: block;
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
    }
}

/* Chat Interface */
.chat-container {
    display: flex;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-top: 40px;
}

.chat-sidebar {
    width: 300px;
    background: #f8fafc;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.chat-rooms-list {
    flex: 1;
    overflow-y: auto;
}

.chat-room-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-room-item:hover,
.chat-room-item.active {
    background: #e2e8f0;
}

.chat-room-item .avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    background: white;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    background: #f1f5f9;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.message.received {
    align-self: flex-start;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 25px;
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

/* Gallery Grid Layout (Strict) */
.gallery-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1 / 1;
    /* Force square aspect ratio for uniform grid */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop images to fit square */
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Modal / Lightbox (for future use) */
.gallery-item {
    cursor: pointer;
}

/* Lightbox / Magnifier Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    z-index: 10001;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--secondary);
}