/* Imagemedia.pt - Premium Design System (Modern Vertical Portal) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #121214;
    --surface-color: #1a1a1e;
    --surface-hover: #222228;
    --border-color: #2c2c34;
    --primary-color: #ff9900;
    --primary-hover: #e08800;
    --secondary-color: #40668c;
    --text-color: #e1e1e6;
    --text-muted: #8d8d99;
    --danger-color: #ff3b30;
    --success-color: #34c759;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html, body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    height: 100%;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
header.app-header {
    background-color: rgba(26, 26, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 2rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.brand img {
    height: 38px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}
.nav-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}
.nav-separator {
    color: var(--border-color);
}

.user-badge {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lang-btn {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}
.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}
.lang-btn.active {
    opacity: 1;
    border-bottom: 2px solid var(--primary-color);
}

/* Main Layout: Two Column Portal */
.portal-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem 2rem;
    gap: 2rem;
}

.portal-sidebar {
    width: 260px;
    flex-shrink: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    align-self: flex-start;
    position: sticky;
    top: 75px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.portal-content {
    flex: 1;
    min-width: 0; /* Prevents flex items from breaking grid widths */
}

/* Titles and Text */
.title, h1, h2, h3 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.text {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
}

/* Modern Form Controls */
.field {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    height: 36px;
    padding: 0 0.75rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    margin-bottom: 0.75rem;
}
.field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

.field_label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Custom Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #121214;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: var(--font-family);
}
.btn:hover {
    background-color: var(--primary-hover);
    color: #121214;
}
.btn:active {
    transform: scale(0.98);
}
.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* Event List Styles */
.year-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.year-badge {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.year-badge:hover, .year-badge.active {
    background-color: var(--primary-color);
    color: #121214;
    border-color: var(--primary-color);
}

.event-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}
.event-card:hover {
    background-color: var(--surface-hover);
    border-color: var(--primary-color);
}
.event-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.event-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.event-lock {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Letras A-Z filter badges */
.letras {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #121214;
    background-color: var(--primary-color);
    height: 20px;
    width: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 4px;
    margin-right: 0.5rem;
}

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

.photo-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}
.photo-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.photo-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Garante proporção quadrada perfeita em Safari antigo */
    background-color: #0b0b0d;
    border-radius: 4px;
    overflow: hidden;
}

.photo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dynamic transparent overlay over images to prevent drags/downloads */
.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
    background-color: rgba(255,255,255,0); /* Transparent */
}

/* Diagonal copyright text stamp over thumbnails for protection */
.thumb-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    pointer-events: none; /* Allows clicks to pass through to the glass overlay */
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: all 0.25s ease-in-out;
}

/* Hover style highlighting the copyright and branding color */
.photo-card:hover .thumb-watermark {
    color: rgba(255, 153, 0, 0.95); /* Orange highlight */
    border-color: rgba(255, 153, 0, 0.4);
    background-color: rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%) rotate(-25deg) scale(1.05);
}

.photo-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.photo-ref {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}
.photo-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Shopping Cart Order Layout */
.cart-table-wrapper {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.cart-table th, .cart-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.cart-table th {
    background-color: #16161a;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cart-table tr:last-child td {
    border-bottom: none;
}

/* Form inputs for checkout cart list items */
.cart-qty-input {
    width: 45px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-align: center;
    border-radius: 4px;
    padding: 0.15rem;
    font-weight: 500;
}

/* Modal Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 10, 12, 0.95);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.show {
    display: flex;
    opacity: 1;
}
.modal-content-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: var(--text-muted);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 30;
}
.modal-close:hover {
    color: var(--primary-color);
}
.modal-body {
    display: flex;
    flex-direction: column;
}
.modal-img-container {
    position: relative;
    background-color: #050507;
    width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.modal-img {
    max-height: 70vh;
    width: 100%;
    object-fit: contain;
}
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 2.5rem;
    font-weight: 300;
    width: 44px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 40;
    user-select: none;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.modal-nav:hover {
    background-color: var(--primary-color);
    color: #121214;
    transform: translateY(-50%) scale(1.1);
}
.modal-nav-prev {
    left: 1.5rem;
}
.modal-nav-next {
    right: 1.5rem;
}
.modal-info-panel {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #1d1d23;
}
.modal-info-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.modal-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.9rem;
}
.modal-info-label {
    color: var(--text-muted);
    font-weight: 500;
}
.modal-info-val {
    color: var(--text-color);
    font-weight: 600;
}

/* Footer styling */
footer.app-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Floating Login Trigger Icon */
.usr-trigger {
    display: block;
    width: 32px;
    height: 32px;
    background: var(--surface-color) url('user.png') no-repeat center center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
    z-index: 90;
}
.usr-trigger:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}
.floating-login-card {
    display: none;
    position: fixed;
    bottom: 4rem;
    right: 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    width: 250px;
    z-index: 100;
}

/* Responsive Overrides */
.cart-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .portal-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1.5rem;
    }
    .portal-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
    .header-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 0.5rem;
    }
    .modal-content-container {
        border-radius: 8px;
    }
    .modal-img-container {
        max-height: 50vh;
    }
    .modal-img {
        max-height: 50vh;
    }
    .modal-info-panel {
        padding: 1rem;
    }
    .modal-info-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    .photo-card {
        padding: 0.25rem;
    }
    header.app-header {
        padding: 0.5rem 1rem;
    }
    .brand img {
        height: 28px;
    }
    .btn {
        width: 100%;
        padding: 0.75rem 1.25rem;
    }
}
