/* ===================================================
   AudioGhid Muzeu — Dark Museum Theme
   =================================================== */

:root {
    --gold:    #C9A84C;
    --gold-dk: #a8883a;
    --bg:      #111111;
    --bg2:     #1E1E1E;
    --bg3:     #2A2A2A;
    --text:    #DDDDDD;
    --text-muted: #888888;
    --danger:  #CC2222;
    --danger-dk: #aa1a1a;
    --success: #2e7d32;
    --border:  #333333;
    --radius:  6px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

/* ===================================================
   Buttons
   =================================================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: #111111;
}

.btn-primary:hover {
    background: var(--gold-dk);
    color: #111111;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-dk);
    color: #ffffff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline:hover {
    background: rgba(201, 168, 76, 0.12);
    text-decoration: none;
}

.btn-full {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ===================================================
   Alerts
   =================================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.alert-danger {
    background: rgba(204, 34, 34, 0.15);
    border: 1px solid var(--danger);
    color: #ff8888;
}

.alert-success {
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid #2e7d32;
    color: #88cc88;
}

.alert-warning {
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid var(--gold);
    color: var(--gold);
}

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

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15);
}

.form-input::placeholder {
    color: #555;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-textarea {
    resize: vertical;
    min-height: 72px;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Custom file input */
.file-input-hidden {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    width: 100%;
}

.file-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    background: var(--bg3);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}

.file-label:hover .file-btn {
    background: rgba(201, 168, 76, 0.12);
}

.file-name {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ===================================================
   Login Page
   =================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 1rem;
}

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 2.5rem;
    display: block;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.login-title {
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.login-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Install warning */
.install-warning {
    margin-top: 1.5rem;
    padding: 0.9rem 1rem;
    background: rgba(204, 34, 34, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: #ff9999;
    line-height: 1.5;
}

.install-warning code {
    font-family: monospace;
    color: var(--gold);
}

/* ===================================================
   Dashboard Layout
   =================================================== */
.dashboard-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.03em;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-username {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Main layout */
.dashboard-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.upload-form {
    /* inherits from form-group etc. */
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-width: 0;
}

/* ===================================================
   Upload Banner
   =================================================== */
.upload-banner {
    background: var(--bg2);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.08);
}

.upload-banner-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.upload-banner-check {
    font-size: 1.5rem;
    color: var(--gold);
    line-height: 1;
    flex-shrink: 0;
}

.upload-banner-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.upload-banner-body {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.qr-banner-container {
    flex-shrink: 0;
    background: #fff;
    padding: 6px;
    border-radius: 4px;
    display: inline-block;
    line-height: 0;
}

.qr-banner-container img,
.qr-banner-container canvas {
    display: block;
}

.upload-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.25rem;
}

.upload-banner-id {
    margin-top: 0.85rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    word-break: break-all;
}

/* ===================================================
   Exhibits Table
   =================================================== */
.table-section {
    /* container */
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.table-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.exhibits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.exhibits-table thead tr {
    background: var(--bg3);
}

.exhibits-table th {
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.exhibits-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.exhibits-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.td-name strong {
    color: var(--text);
    font-size: 0.88rem;
}

.td-desc {
    color: var(--text-muted);
    font-size: 0.78rem;
    display: block;
    margin-top: 2px;
}

.td-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.td-qr {
    text-align: center;
    width: 96px;
}

.qr-thumb {
    width: 80px;
    height: 80px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    overflow: hidden;
    padding: 2px;
    line-height: 0;
}

.qr-thumb img,
.qr-thumb canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.td-actions {
    white-space: nowrap;
    width: 1%;
}

.td-actions .btn + .btn,
.td-actions .btn + form,
.td-actions form + .btn {
    margin-left: 0.4rem;
}

.td-actions form {
    display: inline;
}

/* ===================================================
   Badges
   =================================================== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
}

.badge-lang {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.badge-audio {
    background: rgba(46, 125, 50, 0.15);
    color: #88cc88;
    border: 1px solid rgba(46, 125, 50, 0.3);
}

.badge-no-audio {
    background: rgba(100, 100, 100, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ===================================================
   Empty state
   =================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 1rem;
    }

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

    .upload-banner-body {
        flex-direction: column;
    }

    .upload-banner-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 1rem;
    }

    .topbar-brand {
        font-size: 0.95rem;
    }

    .topbar-username {
        display: none;
    }

    .exhibits-table th:nth-child(3),
    .exhibits-table td:nth-child(3),
    .exhibits-table th:nth-child(5),
    .exhibits-table td:nth-child(5) {
        display: none;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
    }
}
