@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700;800&display=swap');

:root {
    --bg-900: #060b16;
    --text-100: #f8fafc;
    --muted-300: #cbd5e1;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    color-scheme: dark;
}

body {
    font-family: "Rubik", "Segoe UI", sans-serif;
    color: var(--text-100);
    background: var(--bg-900);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
    color-scheme: dark;
}

/* Loading indicators */
.app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-900);
    z-index: 9999;
    color: var(--text-100);
    gap: 1.5rem;
}

.app-loading-logo {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(130deg, #0ea5e9, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.loading-progress {
    position: relative;
    width: 280px;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 99px;
    overflow: hidden;
}

.loading-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #16a34a);
    border-radius: 99px;
    width: 0%;
    animation: loading-fill 3s forwards cubic-bezier(0, 0, 0.2, 1);
}

@keyframes loading-fill {
    0% { width: 0%; }
    100% { width: 92%; }
}

.loading-progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-300);
    font-variant-numeric: tabular-nums;
}

.loading-progress-text::after {
    content: "Завантаження компонентів...";
}

/* Resolve Loader (Overlay for Scan) */
.resolve-loader {
    position: absolute;
    inset: 0;
    background: rgba(6, 11, 22, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 18px;
    animation: fadeIn 0.2s ease-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(14, 165, 233, 0.2);
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.spinner--small {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin-bottom: 0;
}

/* Latest Photo Loading */
.latest-photo__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 1px dashed rgba(14, 165, 233, 0.3);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.4);
    color: var(--muted-300);
    font-size: 0.85rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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