/*
   UCD PRATESE - Custom Design System
   Light theme aligned with the official ucpratese.it palette
   (primary orange #fe5000, dark #1C2024, featured turquoise #65dcdf)
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f7f7f8;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);
    --border-color: rgba(28, 32, 36, 0.12);
    --border-color-glow: rgba(254, 80, 0, 0.35);

    --color-primary: #fe5000;         /* ucpratese.it brand orange */
    --color-primary-hover: #cb4000;   /* darker orange for hover */
    --color-accent: #65dcdf;          /* ucpratese.it "featured" turquoise */
    --color-accent-hover: #3fc7ca;
    --color-accent-text: #0e7a7d;     /* readable turquoise for text on light bg */
    --color-dark: #1C2024;            /* ucpratese.it brand dark */
    --color-text-primary: #1C2024;
    --color-text-secondary: #495057;
    --color-text-muted: #868e96;

    --shadow-sm: 0 1px 2px 0 rgba(28, 32, 36, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(28, 32, 36, 0.08), 0 2px 4px -1px rgba(28, 32, 36, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 32, 36, 0.10), 0 4px 6px -2px rgba(28, 32, 36, 0.04);
    --shadow-glow: 0 0 20px rgba(254, 80, 0, 0.25);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background grid overlay — light, brand-tinted */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(254, 80, 0, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(101, 220, 223, 0.06) 0%, transparent 45%),
        linear-gradient(rgba(28, 32, 36, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 32, 36, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

/* Recursive Header Dropdowns styling */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover, .nav-item.active > .nav-link {
    color: var(--color-primary);
    background: rgba(28, 32, 36, 0.05);
}

/* Nested Submenus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 220px;
    display: none;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 0.25rem;
}

.nav-item:hover > .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    position: relative;
    list-style: none;
}

.dropdown-link {
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    border-radius: 6px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.dropdown-link:hover {
    color: var(--color-text-primary);
    background: rgba(28, 32, 36, 0.06);
}

.dropdown-link span.arrow {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* User actions in header */
.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile user actions (inside nav drawer) - hidden by default */
.mobile-user-actions {
    display: none !important;
}

/* Desktop user actions - visible by default */
.desktop-user-actions {
    display: flex;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background-color: rgba(28, 32, 36, 0.06);
    color: var(--color-text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(28, 32, 36, 0.10);
}

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

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.user-role-tag {
    background: rgba(101, 220, 223, 0.22);
    color: #0e7a7d;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(101, 220, 223, 0.55);
}

.user-role-tag.admin {
    background: rgba(254, 80, 0, 0.15);
    color: var(--color-primary-hover);
    border: 1px solid rgba(254, 80, 0, 0.35);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 6rem 2rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-logo-wrapper {
    margin-bottom: 2rem;
}

.hero-logo {
    height: 200px;
    width: auto;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-title span {
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Page Containers */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Grid & Cards */
.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    border-color: rgba(254, 80, 0, 0.25);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}

.card-desc {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.card-desc p {
    margin-bottom: 0.5rem;
}

.card-desc p:last-child {
    margin-bottom: 0;
}

.card-desc strong {
    font-weight: 600;
}

.card-desc em {
    font-style: italic;
}

/* Sidebar Layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

/* Sidebar tree navigation */
.sidebar-nav {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: fit-content;
}

.tree-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--color-primary);
}

.tree-menu {
    list-style: none;
}

.tree-item {
    margin-bottom: 0.5rem;
}

.tree-link {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.tree-link:hover {
    background: rgba(28, 32, 36, 0.06);
    color: var(--color-text-primary);
}

.tree-item.active > .tree-link {
    color: var(--color-primary);
    background: rgba(254, 80, 0, 0.10);
    font-weight: 600;
}

/* Sub-tree nesting */
.tree-sub {
    list-style: none;
    margin-left: 1.25rem;
    border-left: 1px dashed var(--border-color);
    padding-left: 0.75rem;
    margin-top: 0.25rem;
}

/* Rich Details View */
.detail-header {
    margin-bottom: 2rem;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.detail-content {
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: 3rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-content p {
    margin-bottom: 1.5rem;
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.detail-content h1 { font-size: 2rem; }
.detail-content h2 { font-size: 1.6rem; }
.detail-content h3 { font-size: 1.35rem; }
.detail-content h4 { font-size: 1.15rem; }

.detail-content ul,
.detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.detail-content ul {
    list-style: disc;
}

.detail-content ol {
    list-style: decimal;
}

.detail-content li {
    margin-bottom: 0.5rem;
}

.detail-content li > ul,
.detail-content li > ol {
    margin-bottom: 0;
    margin-top: 0.5rem;
}

.detail-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(28, 32, 36, 0.04);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--color-text-secondary);
    font-style: italic;
}

.detail-content pre {
    background: #f4f4f5;
    color: var(--color-text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.detail-content code {
    background: rgba(28, 32, 36, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.detail-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.detail-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.detail-content a:hover {
    color: var(--color-primary-hover);
}

.detail-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-content th,
.detail-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.detail-content th {
    background: rgba(28, 32, 36, 0.05);
    font-weight: 700;
}

.detail-content figure {
    margin: 1.5rem 0;
    text-align: center;
}

.detail-content figcaption {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

.detail-content strong {
    font-weight: 700;
}

.detail-content em {
    font-style: italic;
}

.detail-image-wrapper {
    width: 100%;
    max-height: 450px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Message Alerts */
.messages-container {
    max-width: 1200px;
    margin: 1.5rem auto 0 auto;
    padding: 0 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-close {
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Forms styling */
.form-card {
    max-width: 550px;
    margin: 3rem auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(28, 32, 36, 0.06);
    border: 1px solid var(--border-color);
    color: var(--color-text-primary);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(254, 80, 0, 0.2);
}

/* Improve contrast for select/option dropdowns */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option {
    background-color: #ffffff;
    color: var(--color-text-primary);
    padding: 0.5rem;
}

.form-select option:hover,
.form-select option:focus,
.form-select option:active,
.form-select option:checked {
    background-color: var(--color-primary);
    color: white;
}

.form-select:focus option:checked {
    background-color: var(--color-primary);
    color: white;
}

/* Firefox and other browsers: force dark dropdown background */
@-moz-document url-prefix() {
    .form-select option {
        background-color: #ffffff;
        color: var(--color-text-primary);
    }
}

.form-checkbox {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.form-file {
    color: var(--color-text-secondary);
}

.form-errors {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    list-style: none;
}

.form-help {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Dashboard Panel */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    height: fit-content;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0 auto 1.5rem auto;
}

.profile-name {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-email {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.profile-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.profile-detail-label {
    color: var(--color-text-secondary);
}

.profile-detail-value {
    font-weight: 600;
}

/* Custom Admin Tab Menu */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    gap: 1rem;
    overflow-x: auto;
}

.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

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

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

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: rgba(28, 32, 36, 0.04);
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

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

.admin-table tr:hover td {
    background: rgba(28, 32, 36, 0.025);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* Footer */
footer {
    background-color: var(--color-dark);
    color: rgba(255, 255, 255, 0.78);
    /* Re-scope text tokens so inline var(--color-text-*) inherit
       the correct on-dark colors inside the footer. */
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.72);
    --color-text-muted: rgba(255, 255, 255, 0.55);
    --border-color: rgba(255, 255, 255, 0.12);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
}

.footer-link-item {
    margin-bottom: 0.75rem;
}

.footer-link-item a {
    color: rgba(255, 255, 255, 0.72);
}

.footer-link-item a:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

/* =============================================
   HOME PAGE & DETAIL PAGES UTILITY CLASSES
   ============================================= */

/* Section spacing */
.section {
    margin-top: 4rem;
}

.section-lg {
    margin-top: 5rem;
    margin-bottom: 3rem;
}

/* Section header with left accent border */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
}

.section-header-accent {
    border-left-color: var(--color-accent);
}

.section-header-accent .section-title + p {
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.section-link {
    color: var(--color-accent-text);
    font-weight: 600;
    font-size: 0.95rem;
}

.section-link:hover {
    text-decoration: underline;
}

.section-desc {
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Back link */
.back-link {
    color: var(--color-accent-text);
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Info / Callout box */
.info-box {
    background: rgba(28, 32, 36, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.info-box-title {
    font-weight: 700;
}

.info-box-text {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
}

.info-box-actions {
    display: flex;
    gap: 1rem;
}

/* Subscribe / CTA box */
.subscribe-box {
    background: rgba(28, 32, 36, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.subscribe-box h3 {
    font-weight: 700;
}

.subscribe-box p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
}

.subscribe-box .btn-group {
    display: flex;
    gap: 1rem;
}

/* Green subscribe button variant */
.btn-success {
    background-color: #10b981;
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

/* Participants section */
.participants-section {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.participants-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.participant-tag {
    background: rgba(28, 32, 36, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.participant-card-number {
    color: var(--color-accent-text);
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* Admin actions bar */
.admin-actions {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-actions-label {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Admin actions inside card (page_detail) */
.admin-actions-card {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Flex utility classes */
.flex {
    display: flex;
}

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

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

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-text); }
.text-success { color: #10b981; }
.text-sm { font-size: 0.95rem; }
.text-xs { font-size: 0.85rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.italic { font-style: italic; }

/* Margin utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width utilities */
.max-w-500 { max-width: 500px; }
.max-w-650 { max-width: 650px; }
.max-w-850 { max-width: 850px; }

/* Image card wrapper */
.img-card-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.img-card-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Event visibility badge */
.visibility-badge {
    font-size: 0.7rem;
}

.visibility-badge.public {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Card footer actions */
.card-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* Full-width button variant */
.btn-full {
    width: 100%;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   MOBILE RESPONSIVE DESIGN
   ============================================= */

/* Hamburger menu button - hidden on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    transition: var(--transition);
    z-index: 1002;
}

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

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

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

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

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

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Tablet and below */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .hero-section {
        padding: 4rem 1.5rem;
    }

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

    .main-content {
        padding: 2rem 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav */
    .hamburger-btn {
        display: flex;
    }

    .nav-container nav {
        display: none;
    }

    .nav-container nav.mobile-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-color);
        z-index: 999;
        overflow-y: auto;
        padding: 5rem 1rem 2rem;
        box-shadow: var(--shadow-lg);
        animation: slideInLeft 0.3s ease;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .nav-item {
        position: static;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        font-size: 1.05rem;
        justify-content: space-between;
    }

    .nav-link .arrow {
        font-size: 0.7rem;
    }

    /* Mobile dropdowns - expand inline instead of hover */
    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(28, 32, 36, 0.05);
        border: none;
        border-left: 2px solid var(--color-primary);
        border-radius: 0 8px 8px 0;
        padding: 0.25rem 0 0.25rem 0.5rem;
        min-width: auto;
        box-shadow: none;
        margin-top: 0.25rem;
        margin-left: 1rem;
    }

    .dropdown-menu .dropdown-menu {
        margin-left: 0.5rem;
    }

    .nav-item:hover > .dropdown-menu {
        display: none;
    }

    .nav-item.dropdown-open > .dropdown-menu {
        display: block;
        animation: fadeIn 0.2s ease;
    }

    .dropdown-link {
        padding: 0.6rem 0.75rem;
        font-size: 0.95rem;
    }

    .dropdown-link span.arrow {
        font-size: 0.7rem;
    }

    /* Show mobile user actions inside nav drawer, hide desktop ones */
    .mobile-user-actions {
        display: block !important;
    }

    .desktop-user-actions {
        display: none !important;
    }

    /* User actions in mobile menu */
    .user-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .user-actions .btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }

    .user-badge {
        width: 100%;
        justify-content: center;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0.5rem;
    }

    /* Hero section */
    .hero-section {
        padding: 3rem 1rem;
    }

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

    .hero-logo {
        height: 130px;
    }

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

    .hero-desc {
        font-size: 1rem;
    }

    /* Grid adjustments */
    .grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.15rem;
    }

    /* Detail pages */
    .detail-title {
        font-size: 1.6rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .detail-content {
        font-size: 1rem;
    }

    .detail-content h1 { font-size: 1.5rem; }
    .detail-content h2 { font-size: 1.3rem; }
    .detail-content h3 { font-size: 1.15rem; }

    .detail-image-wrapper {
        max-height: 250px;
    }

    /* Sidebar */
    .sidebar-nav {
        padding: 1rem;
    }

    /* Forms */
    .form-card {
        max-width: 100%;
        margin: 1.5rem 0.5rem;
        padding: 1.5rem;
    }

    .form-title {
        font-size: 1.4rem;
    }

    .form-input, .form-select, .form-textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* Registration form grid */
    #register-form-grid,
    .register-form-grid,
    form .grid-2-cols,
    form [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Dashboard */
    .profile-card {
        padding: 1.5rem;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .profile-name {
        font-size: 1.2rem;
    }

    /* Admin dashboard */
    .admin-tabs {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 600px;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .actions-cell {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* Admin dashboard header */
    #admin-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* Footer */
    footer {
        padding: 2.5rem 1rem 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-title {
        font-size: 1rem;
    }

    /* Section headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

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

    /* Subscribe box */
    .subscribe-box {
        padding: 1.25rem;
    }

    .subscribe-box .btn-group,
    .subscribe-box .info-box-actions {
        flex-direction: column;
        width: 100%;
    }

    .subscribe-box .btn-group .btn,
    .subscribe-box .info-box-actions .btn {
        width: 100%;
    }

    /* Participants */
    .participants-list {
        gap: 0.5rem;
    }

    .participant-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.75rem;
    }

    /* Photo gallery */
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .photo-card {
        cursor: default;
    }

    .photo-card div:first-child {
        height: 150px !important;
    }

    /* Albums section in event detail */
    .albums-section [style*="grid-template-columns"] {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    /* Attachments */
    .attachment-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .attachment-row > div {
        min-width: 100% !important;
    }

    /* Photo rows in admin form */
    .photo-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .photo-row > div {
        min-width: 100% !important;
        width: 100% !important;
    }

    /* Admin actions */
    .admin-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-actions-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Back link spacing */
    .back-link {
        margin-bottom: 1rem;
    }

    /* Messages */
    .messages-container {
        padding: 0 1rem;
    }

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Event list past events */
    .card[style*="opacity: 0.75"] .card-title {
        font-size: 1rem;
    }

    /* Dashboard event items */
    .dashboard-grid [style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .dashboard-grid [style*="justify-content: space-between"] > div:last-child {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .dashboard-grid [style*="justify-content: space-between"] > div:last-child .btn {
        flex: 1;
        text-align: center;
    }

    /* Album detail header */
    .card [style*="align-items: flex-start"] {
        flex-direction: column;
    }

    .card [style*="align-items: flex-start"] > div:first-child {
        width: 100% !important;
        height: 200px !important;
    }

    /* Admin dashboard header */
    [style*="justify-content: space-between"][style*="border-left: 4px solid var(--color-accent)"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    /* Admin form */
    .form-card[style*="max-width: 700px"] {
        max-width: 100% !important;
    }

    /* Photo dropzone */
    .photo-dropzone {
        padding: 1.5rem 1rem;
    }

    .photo-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }

    /* Confirm delete */
    .form-card[style*="max-width: 500px"] {
        max-width: 100% !important;
        margin: 1.5rem 0.5rem !important;
    }

    /* Lightbox */
    #lightbox-modal {
        padding: 1rem !important;
    }

    #lightbox-modal button {
        top: 0.75rem !important;
        right: 1rem !important;
        font-size: 2rem !important;
    }

    /* Info box */
    .info-box-actions {
        flex-direction: column;
        width: 100%;
    }

    .info-box-actions .btn {
        width: 100%;
    }

    /* Hero buttons */
    .hero-section .flex-center {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-section .flex-center .btn {
        width: 100%;
        max-width: 280px;
    }

    /* Card footer actions */
    .card-footer-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-footer-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Event list card footer */
    [style*="justify-content: space-between"][style*="margin-top: auto"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    [style*="justify-content: space-between"][style*="margin-top: auto"] .btn {
        width: 100%;
        text-align: center;
    }

    /* Admin form submit row */
    .form-card form > div:last-child {
        flex-direction: column;
    }

    .form-card form > div:last-child .btn {
        width: 100%;
    }

    /* Pending users section */
    #tab-users [style*="background: rgba(245, 158, 11"] {
        padding: 1rem !important;
    }

    /* Tree navigation */
    .tree-title {
        font-size: 1rem;
    }

    .tree-link {
        font-size: 0.9rem;
        padding: 0.35rem 0.6rem;
    }

    /* Logo */
    .logo-img {
        height: 36px;
    }

    /* Section spacing */
    .section {
        margin-top: 2.5rem;
    }

    .section-lg {
        margin-top: 3rem;
        margin-bottom: 2rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
    }

    /* Admin create buttons */
    .admin-tab-panel > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .admin-tab-panel > div:first-child .btn {
        width: 100%;
        text-align: center;
    }

    /* User edit link in admin */
    .actions-cell .btn {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    /* Pending users action forms */
    #tab-users form {
        display: inline;
    }

    #tab-users .actions-cell {
        flex-wrap: nowrap;
    }

    #tab-users .actions-cell .btn {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-section {
        padding: 2rem 0.75rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .nav-container {
        padding: 0.5rem 0.75rem;
    }

    .logo-link {
        font-size: 1.1rem;
    }

    .logo-badge {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .hamburger-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
        gap: 4px;
    }

    .nav-container nav.mobile-open {
        width: 100%;
        max-width: none;
    }

    .card {
        padding: 1rem;
    }

    .detail-title {
        font-size: 1.4rem;
    }

    .form-card {
        padding: 1.25rem;
    }

    .form-title {
        font-size: 1.3rem;
    }

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

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    }

    .photo-card div:first-child {
        height: 120px !important;
    }

    .albums-section [style*="grid-template-columns"] {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    }

    .admin-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .footer-container {
        gap: 1.5rem;
    }

    .user-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        min-width: 100px;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .detail-content h1 { font-size: 1.35rem; }
    .detail-content h2 { font-size: 1.2rem; }
    .detail-content h3 { font-size: 1.1rem; }

    .participant-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    .profile-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .profile-name {
        font-size: 1.1rem;
    }
}

/* Slide-in animation for mobile menu */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Touch-friendly: increase tap targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .dropdown-link,
    .tree-link,
    .btn,
    .admin-tab-btn,
    .photo-card {
        cursor: default;
    }

    .nav-link {
        padding: 0.85rem 1rem;
    }

    .dropdown-link {
        padding: 0.7rem 0.75rem;
    }

    .tree-link {
        padding: 0.5rem 0.75rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
    }

    .admin-tab-btn {
        padding: 0.7rem 1.2rem;
    }

    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: none;
    }

    .card:active {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .btn-primary:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .btn-primary:active {
        transform: translateY(-1px);
        box-shadow: var(--shadow-glow);
    }

    .photo-card:hover {
        transform: none;
    }

    .photo-card:active {
        transform: translateY(-2px);
    }
}
