/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f5f4f2;
    --color-surface: #ffffff;
    --color-primary: #7a2232;
    --color-primary-dark: #5e1a27;
    --color-accent: #6b6b6b;
    --color-accent-dark: #555555;
    --color-text: #2c2c2c;
    --color-text-light: #777777;
    --color-border: #d9d5d0;
    --color-danger: #b34040;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 8px;
    --max-width: 1100px;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }
a.btn:hover { color: #fff; }

/* ===== Navigation ===== */
.navbar {
    background: var(--color-surface);
    border-bottom: 3px solid var(--color-primary);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 64px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    letter-spacing: 0.5px;
}

/* Hamburger button */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 301;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Slide-out menu overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Slide-out menu */
.navbar-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--color-surface);
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 80px 1rem 2rem;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.navbar-links.open {
    transform: translateX(0);
}

.navbar-links li {
    margin-bottom: 0.25rem;
}

.navbar-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--color-text);
    font-weight: 500;
    font-size: 1.05rem;
    transition: background 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
    background: var(--color-primary);
    color: #fff;
}

.navbar-links .btn-logout {
    background: none;
    border: 1px solid var(--color-border);
    cursor: pointer;
    font: inherit;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    color: var(--color-text-light);
    width: 100%;
    text-align: left;
    font-size: 1.05rem;
}
.navbar-links .btn-logout:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Hero ===== */
.hero {
    background: url('/images/hero-bg.jpg') center center / cover no-repeat;
    color: #fff;
    text-align: center;
    padding: 0;
    position: relative;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(40, 10, 15, 0.55);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 5rem 2rem;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3 {
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.card .subtitle {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* ===== Member Photo ===== */
.member-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}
.btn-accent:hover { background: var(--color-accent-dark); }

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.95rem;
    background: var(--color-surface);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

select.form-control {
    cursor: pointer;
}

/* ===== Login Form ===== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
}

.login-box {
    background: var(--color-surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 380px;
    border-top: 4px solid var(--color-primary);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-primary-dark);
}

.login-box .error-msg {
    background: #fce8e8;
    color: var(--color-danger);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

/* ===== Table ===== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background: var(--color-primary);
    color: #fff;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
}

tbody tr:hover {
    background: #f5f3ef;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    align-items: end;
}

.search-bar .form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

/* ===== Admin Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: var(--color-text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--color-primary-dark);
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

.page-title {
    font-size: 1.8rem;
    color: var(--color-primary-dark);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
}

.modal-lg {
    max-width: 640px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--color-primary-dark);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* ===== Notation Parts ===== */
.notation-part {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.notation-part:last-child {
    border-bottom: none;
}

.notation-part-name {
    font-weight: 600;
    min-width: 120px;
}

.notation-part-file {
    color: var(--color-text-light);
    font-size: 0.9rem;
    flex: 1;
}

/* ===== Clickable Rows ===== */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #ece9e3;
}

.text-muted {
    color: var(--color-text-light);
}

/* ===== Gallery ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-album-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.gallery-album-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-album-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.gallery-album-info {
    padding: 1rem 1.25rem;
}

.gallery-album-info h3 {
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.gallery-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.gallery-thumb {
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.gallery-thumb:hover {
    border-color: var(--color-primary);
    transform: scale(1.03);
}

.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.gallery-thumb-video {
    position: relative;
}

.gallery-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

.lightbox-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    outline: none;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 501;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    z-index: 501;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 3rem 1.5rem; }
    .navbar { padding: 0 1rem; }
    .search-bar { flex-direction: column; }
    .search-bar .form-group { min-width: 100%; }
}
