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

:root {
    --primary: #8B4513;
    --primary-dark: #6B3410;
    --primary-light: #A0522D;
    --accent: #D4A574;
    --bg: #FAF5EF;
    --bg-card: #FFFFFF;
    --text: #2C1810;
    --text-light: #6B4C3B;
    --border: #E8D5C4;
    --success: #2E7D32;
    --error: #C62828;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(44, 24, 16, 0.1);
    --font: 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Typography === */
h1, h2, h3, h4 {
    font-family: var(--font);
    color: var(--text);
}

h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }

/* === Header / Hero === */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}

.hero h1 {
    color: var(--primary);
    font-size: 2.5rem;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* === Page Header === */
.page-header, .admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    margin-bottom: 0;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

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

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

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

.btn-qr {
    background: var(--accent);
    color: var(--text);
}
.btn-qr:hover {
    background: var(--primary-light);
    color: #fff;
}

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

/* === QR Cards === */
.master-qr-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.qr-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
}

.qr-card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.qr-display {
    margin-bottom: 1rem;
}

.qr-code-img {
    max-width: 300px;
    height: auto;
    border: 3px solid var(--border);
    border-radius: var(--radius);
}

.qr-description {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.qr-url {
    word-break: break-all;
    margin-bottom: 1rem;
}

.qr-url a {
    color: var(--primary-light);
    font-size: 0.8rem;
}

/* === Stats === */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: var(--font);
}

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

/* === How It Works === */
.how-it-works {
    margin-bottom: 3rem;
    text-align: center;
}

.how-it-works h2 {
    margin-bottom: 2rem;
    color: var(--primary);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.step h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

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

/* === Admin Obras Grid === */
.obras-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.obra-card-admin {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
}

.obra-admin-info h3 {
    margin-bottom: 0.25rem;
}

.artista {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.obra-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #E8F5E9;
    color: var(--success);
}

.badge-inactive {
    background: #FFEBEE;
    color: var(--error);
}

.slug {
    color: var(--text-light);
    font-family: monospace;
}

.obra-admin-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.obra-qr-codes {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qr-mini {
    text-align: center;
    flex: 1;
}

.qr-mini strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.qr-mini img {
    width: 120px;
    height: 120px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.qr-link {
    display: block;
    font-size: 0.7rem;
    color: var(--primary-light);
    word-break: break-all;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* === Alert === */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    color: var(--success);
}

.alert-error {
    background: #FFEBEE;
    border: 1px solid #EF9A9A;
    color: var(--error);
}

/* === Success QR Display === */
.success-qrcodes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qr-pair {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.qr-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.qr-box h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.qr-box img {
    width: 150px;
    height: 150px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.qr-url-display {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-light);
    word-break: break-all;
}

.qr-warning {
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 0.5rem;
}

/* === Edit QR Section === */
.edit-qr-section {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.qr-mini-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.qr-mini-box img {
    width: 100px;
    height: 100px;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.qr-mini-box small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-light);
    word-break: break-all;
}

/* === Forms === */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-container h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.obra-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

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

.form-group input[type="file"] {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.form-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.current-image {
    margin-bottom: 0.5rem;
}

.preview-img {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.current-image p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* === Obra Detail Page === */
.obra-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .obra-detail {
        grid-template-columns: 1fr;
    }
}

.obra-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.obra-info h1 {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.obra-artista {
    font-size: 1.15rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.obra-metadata {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.meta-item dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
}

.meta-item dd {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 0.15rem;
}

.obra-descricao h2 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.obra-descricao p {
    line-height: 1.8;
    color: var(--text);
}

/* === Accessibility Section === */
.obra-acessibilidade {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.obra-acessibilidade h2 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.acessibilidade-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.acessibilidade-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

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

.acessibilidade-icon {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.acessibilidade-card h3 {
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.acessibilidade-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.audio-player-wrapper {
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.soundcloud-player {
    display: block;
    border-radius: var(--radius);
}

.video-player-wrapper {
    margin-bottom: 0.75rem;
}

.video-aspect {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
}

.form-help {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.qr-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media print {
    .btn, .qr-actions, .admin-nav, .form-actions, .obra-admin-actions,
    .page-header .btn, footer {
        display: none !important;
    }
    .qr-card, .qr-box, .qr-mini-box {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* === Footer === */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* === Print === */
@media print {
    .btn, .admin-nav, .form-actions, .obra-admin-actions,
    .page-header .btn, footer {
        display: none !important;
    }
    .qr-card, .qr-box, .qr-mini-box {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
