/* Salon Milena - Dark Theme Redesign */
/* Inspired by glassbosnjace.svilenkovic.rs */

:root {
    --bg: #0b0f14;
    --panel: #121820;
    --panel-2: #0e141b;
    --surface: #1a1f2e;
    --text: #ffffff;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --primary: #b23a9a;
    --primary-2: #f857a6;
    --border: rgba(148, 163, 184, 0.2);
    --border-strong: rgba(148, 163, 184, 0.35);
    --primary-alpha: rgba(178, 58, 154, 0.15);
    --danger: #ef4444;
    --danger-alpha: rgba(239, 68, 68, 0.15);
    --placeholder: #64748b;
    --radius: 10px;
    --radius-md: 12px;
    --card-bg: #1a2332;
    --input-bg: rgba(255,255,255,0.04);
    --hover-bg: rgba(148,163,184,.08);
}

* {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Tabs */
.tabovi {
    display: flex;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    font-family: inherit;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    background: var(--bg);
}

/* Form box */
.unos-box {
    background: var(--panel);
    padding: 12px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

/* Form grid layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

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

/* Form elements */
form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

input, select {
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border-strong);
    font-size: 0.92rem;
    background: var(--panel-2);
    color: var(--text);
    width: 100%;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

::placeholder {
    color: var(--placeholder);
    font-weight: 500;
}

::-webkit-input-placeholder { color: var(--placeholder); }
::-moz-placeholder { color: var(--placeholder); }

button {
    font-family: inherit;
    cursor: pointer;
}

/* Submit button */
.btn-submit {
    padding: 10px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    width: 100%;
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Next appointment */
#sledeci-termin {
    background: var(--panel);
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    margin: 8px;
    font-size: 0.9rem;
    color: var(--muted-strong);
    font-weight: 500;
    display: none;
    border-radius: var(--radius);
}

#sledeci-termin b {
    color: var(--primary);
}

/* Day header */
.dan-naslov {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, rgba(178, 58, 154, 0.2) 0%, rgba(248, 87, 166, 0.1) 100%);
    border: 1px solid rgba(178, 58, 154, 0.25);
    margin: 8px 8px 4px 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: sticky;
    top: 42px;
    z-index: 5;
    backdrop-filter: blur(8px);
}

.dan-naslov span {
    flex: 1;
    font-size: 0.88rem;
}

/* Delete all for day button - inline */
.btn-dan-delete {
    background: var(--danger-alpha);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-dan-delete:active {
    transform: scale(0.96);
}

/* Appointment cards */
.termin {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 0;
    margin: 4px 8px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--border);
    transition: all 0.2s;
    overflow: hidden;
}

.termin-content {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.termin-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.termin-header strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}

.termin-header .termin-usluga {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.termin .termin-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 0.85rem;
    align-items: center;
    color: var(--muted-strong);
}

.termin .termin-details span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.termin .termin-actions {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

/* Icon buttons */
.icon-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex: 1;
}

.icon-btn + .icon-btn {
    border-top: 1px solid var(--border);
}

.icon-btn:active {
    transform: scale(0.9);
}

.icon-delete svg {
    width: 20px;
    height: 20px;
}

.icon-edit {
    font-size: 1.15rem;
    text-align: center;
}

.icon-delete svg {
    fill: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--panel);
    margin: 0;
    padding: 16px 12px;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    border: none;
    position: relative;
    overflow-y: auto;
}

.modal-content h3 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-align: center;
}

.close {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 2rem;
    color: var(--muted);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

#izmeni-form input {
    font-size: 0.92rem;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    color: var(--text);
    background: var(--panel-2);
    border: 1.5px solid var(--border-strong);
}

#izmeni-form button {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Empty state */
#termini-lista p,
#arhiva-lista p {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 30px 16px;
    margin: 8px;
    font-style: italic;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* Archive search */
.arhiva-search {
    margin: 0;
    padding: 8px;
}

.arhiva-search input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border-strong);
    font-size: 0.92rem;
    background: var(--panel-2);
    font-weight: 500;
}

.arhiva-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(178, 58, 154, 0.3);
    opacity: 0;
    pointer-events: none;
    z-index: 3000;
    max-width: 90vw;
    text-align: center;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes shakeOnError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.fadeIn { animation: fadeIn 0.3s; }
.fadeOut { animation: fadeOut 0.3s; }

/* Ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(178, 58, 154, 0.2);
    transform: scale(0);
    animation: rippleEffect 0.5s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
