/* 
   ========================================================
   STYLE BAZOWE - Tutaj są podstawy układu, nieważne od motywu
   Wszystkie kolory i fonty są zasysane ze zmiennych z plików themes/
   ========================================================
*/

@font-face {
    font-family: 'ITC Edwardian Script';
    src: url('fonts/edwardianscriptitc.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --transition-speed: 0.3s;
}

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

html {
    background-color: var(--bg-color);
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100.3vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Warstwy zdjęć tła — dwie naprzemiennie do płynnego cross-fade */
.bg-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    pointer-events: none;
}

.bg-layer.active {
    opacity: 1;
}

/* Ciemna przesłona nad zdjęciem */
.background-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay, transparent);
    z-index: 1;
    pointer-events: none;
}

/* ::after nie jest już potrzebne — sam .background-overlay jest ciemną przesłoną */

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    z-index: 10; /* Zawsze najwyżej */
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.couple-names {
    font-family: var(--font-accent);
    font-size: var(--accent-size);
    color: var(--accent-color);
    margin-bottom: 5px;
    font-weight: normal; /* Upewnienie się, że pogrubienie jest wyłączone */
    -webkit-font-smoothing: antialiased; /* Wygładzanie na Mac/iOS (sprawia, że font jest smuklejszy) */
    -moz-osx-font-smoothing: grayscale;
    /* Usunięto text-shadow, który mógł wizualnie pogrubiać tak delikatną czcionkę */
}

.wedding-date {
    font-family: var(--font-heading);
    font-size: 1.4rem; /* Powiększony napis zachęty */
    opacity: 0.9;
    letter-spacing: 1px;
    line-height: 1.4; /* Poprawiona czytelność przy większym tekście */
}

/* KARTA UPLOADU (Glassmorphism) */
.upload-section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 25px; /* Delikatnie bardziej owalne rogi */
    padding: 11px 15px; /* Zmniejszono o połowę zgodnie z prośbą */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all var(--transition-speed);
    width: fit-content; /* Dopasuj szerokość do zawartości (przycisku) */
    margin: 0 auto; /* Wyśrodkuj kartę po zmniejszeniu szerokości */
}

/* STREFA UPUSZCZANIA / WYBORU PLIKÓW */
.file-drop-area {
    position: relative;
    border: none;
    padding: 0; /* Całkowicie skasowany padding */
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.file-drop-area:hover, .file-drop-area.drag-over {
    transform: translateY(-2px);
}

.choose-file-button {
    display: inline-block;
    padding: 18px 35px; /* Powiększony button */
    background: var(--accent-color);
    color: var(--btn-text-color);
    border-radius: 15px; /* Dopasowane do promienia kontenera zewnetrznego (bez efektu pigułki) */
    font-size: 1.25rem; /* Zwiększony rozmiar czcionki */
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 0; /* Usunięto margines by zwęzić blok */
    pointer-events: none; /* Aby klik szedł do inputa */
    transition: transform var(--transition-speed);
}

.file-drop-area:active .choose-file-button {
    transform: scale(0.95);
}

.file-message {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    pointer-events: none;
}

#file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0;
}

/* PODGLĄD PLIKÓW */
.preview-container {
    margin-top: 25px;
    animation: fadeIn 0.4s ease-out;
}

.preview-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.thumbnails-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 180px;
    overflow-y: auto;
    padding: 5px;
}

.thumbnail-wrapper {
    position: relative;
    width: 85px;
    height: 85px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.thumbnail-wrapper img, .thumbnail-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
    transition: background var(--transition-speed), transform var(--transition-speed);
    padding: 0;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.video-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; justify-content: center; align-items: center;
    font-size: 10px;
}

/* PRZYCISKI */
.submit-btn {
    margin-top: 25px;
    width: 100%;
    padding: 18px 35px;
    border: none;
    background: var(--accent-color);
    color: var(--btn-text-color);
    border-radius: 15px;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all var(--transition-speed);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.secondary-btn {
    margin-top: 20px;
    padding: 16px 33px;
    font-size: 1.25rem;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--accent-color);
    color: var(--btn-text-color);
}

/* PASEK POSTĘPU */
.progress-container {
    padding: 20px 0;
}
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

/* EKRAN SUKCESU */
.success-container {
    animation: fadeIn 0.5s ease;
}
.success-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: heartBeat 1.5s infinite;
}
.success-container h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 10px;
}

/* UTILS */
.hidden { display: none !important; }

/* PANEL TESTOWY MOTYWÓW (DEV) */
.dev-toggle-btn {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background 0.3s;
}

.dev-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.theme-switcher {
    position: fixed;
    bottom: 70px; /* Nad przyciskiem */
    right: 15px;
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #ccc;
    z-index: 9998;
    display: flex;
    flex-direction: column; /* Lista jeden pod drugim */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.theme-switcher button {
    margin: 4px 0; 
    padding: 8px 10px; 
    border: 1px solid #ccc;
    background: white; 
    border-radius: 5px; 
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.theme-switcher button:hover {
    background: #f0f0f0;
}

/* ANIMACJE */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}
@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
}
