.btn {
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg);
    border: 1px solid var(--gold-pale);
    color: var(--ink-soft);
}

select {
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    margin: 10px 0px;
    width: 100%
}

button {
    transition: all 0.3s ease;
}

button:hover {
    opacity: 0.8;
}

.edit-icon-btn {
    background: none;
    border: none;
    font-size: 33px;
    vertical-align: super;
    cursor: pointer;
    opacity: 0.5;
    margin-left: 8px;
    transition: opacity 0.2s;
    color: var(--bg);
    position: absolute;
    top: -10px;
}

.edit-icon-btn:hover {
    opacity: 1;
}

[data-editable="true"] {
    cursor: pointer;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--card);
    padding: 32px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.modal-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.modal-box input {
    width: 100%;
    padding: 10px;
    font-family: var(--serif);
    font-size: 1.1em;
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 16px;
}

.modal-box textarea {
    width: 100%;
    padding: 10px;
    font-family: var(--serif);
    font-size: 1.3em;
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 16px;
    height: 120px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-save-btn {
    background: var(--gold);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.p-relative {
    position: relative;
    cursor: pointer;

}

.p-aboslute {
    position: absolute;
}

/* gumbići van konfiga */

.uredi-actions {
    position: fixed;
    right: 0px;
    bottom: 20px;
    display: grid;
    justify-items: end;
    z-index: 999;
}

.stil-btn {
    background: var(--ink);
    color: #fff;
    border-left: 2px solid #767676;
}

.uredi-actions .btn {
    margin-top: 8px;
    padding: 18px 32px;
    border: none;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0px;
    background: #4c4c4c;
    margin-bottom: 3px;
    border-radius: 0;
}

.uredi-actions .btn.submit-btn {
    margin-top: 0px;
    background: #066619;
    color: white;
}

.uredi-actions .btn.submit-btn:hover {
    opacity: 1;
    background: #00831a;
}

.schemes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.scheme-btn {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 14px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    transition: border-color 0.2s, transform 0.15s;
    text-align: left;
}

.scheme-btn:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.scheme-btn.active {
    border-color: var(--ink);
}

.scheme-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.scheme-name {
    font-size: 12px;
    color: var(--ink);
    line-height: 1.3;
}

.scheme-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 1px;
}

/* editable wrapper stil */

.program-item.editable-wrapper {
    display: grid;
    grid-template-columns: 64px 1fr;
    padding: 22px 0;
    border-bottom: 0.5px dotted var(--rule);
    align-items: start;
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin: 0;
}

.editable-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    border: 1px dashed transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-icon-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stil za SVG unutar dugmeta */
.edit-icon-btn svg {
    width: 14px;
    height: 14px;
}


/* --- DESKTOP (Uređaji sa mišem / hover podrškom) --- */
@media (hover: hover) {

    /* U mirovanju je sakriveno */
    .edit-icon-btn {
        opacity: 0;
        transform: scale(0.8);
        pointer-events: none;
    }

    /* Prikaz na hover */
    .editable-wrapper:hover {
        background-color: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
    }

    .editable-wrapper:hover .edit-icon-btn {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    .edit-icon-btn:hover {
        background: #000000;
        color: #ffffff;
        border-color: #000000;
    }
}


/* --- MOBILNI UREĐAJI (Touchscreen bez hovera) --- */
@media (hover: none) {

    /* Na mobitelu tekst ima blagu istačkanu ivicu permanentno */
    .editable-wrapper {
        border-color: rgba(0, 0, 0, 0.15);
        background-color: rgba(0, 0, 0, 0.02);
    }

    /* Ikona je stalno vidljiva u uglu */
    .edit-icon-btn {
        opacity: 0.9;
        transform: scale(0.9);
        pointer-events: auto;
    }

    /* Vizuelni odziv na pritisak prstom (tap) */
    .editable-wrapper:active {
        background-color: rgba(0, 0, 0, 0.08);
    }
}

/* figure loading */

.foto-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.foto-loading-overlay.active {
    display: flex;
}

.spinner-icon {
    width: 36px;
    height: 36px;
    color: var(--gold);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Blago zatamni sliku ispod dok se učitava, za dodatni vizualni signal */
figure.uploading img {
    filter: brightness(0.7);
    transition: filter 0.2s;
}


.fotke article .editable-wrapper button {
    top: 37%;
    left: 42%;
    transform: scale(2);
}

.fotke article .editable-wrapper:hover button {
    top: 37%;
    left: 42%;
    transform: scale(2);
}

.fotke article .editable-wrapper:hover .edit-icon-btn:hover {
    background: white;
    color: initial;
    border-color: #d2d2d2;
}

.fotke figure:has(figcaption):hover img {
    opacity: 0.6;
}

.fotke article figcaption.editable-wrapper button,
.fotke article figcaption.editable-wrapper:hover button {
    transform: scale(1) !important;
    bottom: 0px;
    right: 0px;
    top: initial;
    left: initial;
}

.fotke figure div img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.fotke figure .editable-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    min-height: 25px;
}

button#programAddBtn {
    margin-top: 20px;
    width: 100%;
    background: var(--gold-pale);
}

.overForm {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    overflow: hidden;
}

.overForm form {
    user-select: none;
    filter: grayscale(40%) opacity(0.65);
    pointer-events: none;
}

/* Overlay Layer */
.overForm::after {
    content: "Formular za goste";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: all;
    cursor: not-allowed;
}

.modal-box-uspjeh,
.modal-box-greska {
    text-align: center;
}

.uspjeh-icon {
    font-size: 2.3em;
    color: var(--gold);
    margin-bottom: 12px;
    font-family: var(--serif);
}

.greska-icon {
    font-size: 1.8em;
    color: #b5443a;
    margin-bottom: 12px;
    font-family: var(--serif);
}

.modal-actions-uspjeh {
    flex-direction: column;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.9em;
    letter-spacing: 0.03em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

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

.btn-secondary {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
}

.btn-primary:hover,
.btn-secondary:hover {
    opacity: 0.85;
}