/* Import same tokens */
:root {
    --ink:        #060504;
    --ink-mid:    #0E0C0B;
    --ink-soft:   #1A1816;
    --cream:      #EDEAE3;
    --cream-dim:  #C4BFBA;
    --gold:       #C8973A;
    --gold-lt:    #E2B95A;
    --muted:      #5C5750;
    --border:     rgba(237,234,227,0.07);
    --border-mid: rgba(237,234,227,0.13);

    --ff-display: 'Space Grotesk', system-ui, sans-serif;
    --ff-serif:   'DM Serif Display', Georgia, serif;
    --ff-body:    'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    background: var(--ink);
    color: var(--cream);
    font-family: var(--ff-body);
    line-height: 1.6;
    min-height: 100vh;
}
button, input, select, textarea {
    font-family: inherit;
}

/* ==================== BUTTONS ==================== */
.btn-solid-gold {
    display: inline-block;
    background: var(--gold);
    color: var(--ink);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-solid-gold:hover { background: var(--gold-lt); }

.btn-outline {
    background: transparent;
    color: var(--cream);
    border: 1px solid var(--border-mid);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-outline:hover { background: rgba(255,255,255,0.05); }

/* ==================== FORMS ==================== */
.field { margin-bottom: 1.5rem; }
.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--cream-dim);
    margin-bottom: 0.5rem;
}
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--ink-soft);
    border: 1px solid var(--border-mid);
    color: var(--cream);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ==================== LOGIN VIEW ==================== */
#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}
.login-card {
    background: var(--ink-mid);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-logo {
    font-family: var(--ff-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.login-logo em { font-family: var(--ff-serif); font-style: italic; font-weight: 400; color: var(--gold); }
.login-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.login-desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2rem;
}
.error-msg {
    color: #e57373;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.login-card button { width: 100%; margin-top: 1rem; }
.back-link {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}
.back-link:hover { color: var(--gold); }

/* ==================== DASHBOARD VIEW ==================== */
#dashboard-view {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    background: var(--ink-mid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    padding: 2rem;
    font-family: var(--ff-display);
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand em { font-family: var(--ff-serif); font-style: italic; font-weight: 400; color: var(--gold); }
.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
}
.nav-item {
    display: block;
    padding: 1rem 2rem;
    color: var(--cream-dim);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--cream); }
.nav-item.active { border-left: 3px solid var(--gold); background: rgba(200,151,58,0.05); color: var(--gold); }

.sidebar-bottom {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.sidebar-bottom .nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid transparent;
}
.nav-back { background: rgba(255,255,255,0.03); color: var(--cream); border-color: rgba(255,255,255,0.05); }
.nav-back:hover { background: rgba(255,255,255,0.08); color: var(--gold); border-color: rgba(200,151,58,0.3); }
.nav-logout { background: rgba(255,60,60,0.05); color: #ff6b6b; border-color: rgba(255,60,60,0.1); }
.nav-logout:hover { background: rgba(255,60,60,0.15); color: #ff4747; border-color: rgba(255,60,60,0.3); }

.main-content {
    flex: 1;
    padding: 3rem 4rem;
    background: var(--ink);
    overflow-y: auto;
}
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}
.main-header h2 { font-family: var(--ff-display); font-size: 2rem; }
.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.sort-select {
    appearance: none;
    background-color: var(--ink-soft);
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1.5L6 6.5L11 1.5" stroke="%23C8973A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 10px;
    
    border: 1px solid var(--border-mid);
    color: var(--cream);
    padding: 0.8rem 3rem 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.sort-select:hover {
    border-color: rgba(200,151,58,0.5);
    background-color: rgba(255,255,255,0.03);
}
.sort-select:focus { 
    outline: none; 
    border-color: var(--gold); 
    box-shadow: 0 0 0 3px rgba(200,151,58,0.15);
}

/* ==================== DATA TABLE ==================== */
.table-container {
    background: var(--ink-mid);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.2);
}
.data-table td { font-size: 0.95rem; }
.data-table tr:last-child td { border-bottom: none; }
.table-img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border-mid); }

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-available { background: rgba(200,151,58,0.15); color: var(--gold-lt); }
.status-reserved { background: rgba(255,255,255,0.05); color: var(--muted); }
.status-planned { background: rgba(92,87,80,0.15); color: var(--cream-dim); }

.action-btns { display: flex; gap: 0.5rem; }
.btn-icon {
    background: var(--ink-soft);
    border: 1px solid var(--border-mid);
    color: var(--cream);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.btn-icon:hover { background: rgba(255,255,255,0.05); }
.btn-delete { color: #e57373; border-color: rgba(229,115,115,0.3); }
.btn-delete:hover { background: rgba(229,115,115,0.1); }

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 2rem;
}
.modal-content {
    background: var(--ink-mid);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.modal-header h3 { font-family: var(--ff-display); font-size: 1.5rem; }
.close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover { color: var(--cream); }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.img-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.file-input {
    flex: 1;
    padding: 0.6rem !important;
}
.img-or {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
}

/* ==================== GALLERY ADMIN VIEW ==================== */
.gallery-admin-container {
    background: var(--ink-mid);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    overflow-x: auto;
}
.gallery-tracks {
    display: flex;
    flex-direction: column;
}
.gallery-track {
    display: none;
    width: 100%;
}
.gallery-track.active {
    display: block;
}

.gallery-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.gi {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--ink);
    aspect-ratio: 4 / 5;
}
.gi:hover {
    transform: scale(0.98);
    box-shadow: 0 0 0 2px var(--gold);
}
.gi::after {
    content: 'Szerkesztés';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: var(--cream);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}
.gi:hover::after { opacity: 1; }

.gi img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.gi-cap {
    position: absolute;
    bottom: 1rem; left: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Gallery Modal specific */
.gallery-preview-wrap {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--ink);
    border: 1px solid var(--border-mid);
}
.gallery-preview-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
}

/* Toggle Buttons */
.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.gallery-toggle {
    position: relative;
    display: inline-flex;
    background: var(--ink-soft);
    border-radius: 50px;
    padding: 0.25rem;
    border: 1px solid var(--border-mid);
}
.gt-slider {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 0.25rem;
    width: 0;
    background: var(--gold);
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}
.gt-btn {
    position: relative;
    z-index: 2;
    background: transparent !important;
    border: none;
    color: var(--cream-dim);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.4s ease;
}
.gt-btn:hover { color: var(--cream); }
.gt-btn.active { color: var(--ink); }

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #2E7D32; /* Green success */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-in 0.3s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.error { background: #D32F2F; }
@keyframes toast-in {
    to { opacity: 1; transform: translateY(0); }
}
.toast.fade-out {
    animation: toast-out 0.3s forwards;
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-20px); }
}

/* ==================== RESPONSIVE (MOBILE) ==================== */
@media (max-width: 768px) {
    #dashboard-view { flex-direction: column; }
    
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: column; height: auto; position: relative; }
    .sidebar-brand { padding: 1rem; text-align: center; border-bottom: 1px solid var(--border); }
    .sidebar-nav { padding: 0.5rem; display: flex; overflow-x: auto; gap: 0.5rem; border-bottom: 1px solid var(--border); }
    .sidebar-bottom { padding: 0.5rem; display: flex; flex-direction: row; justify-content: center; gap: 0.5rem; }
    
    .nav-item { width: auto; flex: 1; text-align: center; padding: 0.8rem; font-size: 0.85rem; border-left: none; border-radius: 6px; white-space: nowrap; }
    .nav-item.active { border-left: none; background: rgba(200,151,58,0.1); color: var(--gold); border: 1px solid rgba(200,151,58,0.3); }
    
    .main-content { padding: 1.5rem; }
    .main-header { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
    .header-actions { width: 100%; flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    
    .sort-select, .btn-solid-gold { width: 100%; text-align: center; }
    
    .table-container { overflow-x: auto; padding-bottom: 1rem; }
    .data-table th, .data-table td { padding: 1rem 0.8rem; font-size: 0.85rem; white-space: nowrap; }
    .data-table td:last-child:not([colspan]) { white-space: normal; min-width: 120px; display: flex; flex-direction: column; gap: 0.5rem; }
    
    .modal-content { padding: 1.5rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    
    .gallery-panel { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
    
    .login-card { padding: 2rem 1.5rem; border: none; background: transparent; }
    #login-view { padding: 1rem; align-items: flex-start; margin-top: 2rem; }
}
