/* assets/css/style.css */
@import 'variables.css';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* TŁO STRONY I BAZA */
body {
    background-image: url('/assets/img/background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    
    /* NOWE: Wymuszenie stopki na dole */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%; /* Dla pewności */
    
    /* NOWE: Rozpychanie kontenera */
    flex: 1;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.navbar a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
}

/* GRID (Siatka kafelków) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* CARD (Kwadratowy kafelek ze szkiełkiem) */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    aspect-ratio: 1 / 1; /* Wymusza idealny kwadrat! */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.card:hover {
    background: rgba(255, 255, 255, 0.671); /* Przy najechaniu traci przezroczystość */
    transform: translateY(-5px); /* Delikatnie unosi kafelek */
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow-wrap: break-word; /* Nakazuje uciąć i przenieść za długie słowo */
    word-break: break-word; /* Dodatkowe wsparcie dla tasiemców */
    overflow: hidden; /* Odcina wszystko, co próbuje wyjść za burtę */
}

/* ZDJĘCIE W KAFELKU */
.card-img {
    width: 80px; /* Stała szerokość */
    height: 80px; /* Stała wysokość */
    border-radius: 50%; /* Tworzy idealne koło */
    object-fit: cover; /* Ucina zdjęcie tak, by zachowało proporcje i wypełniło koło */
    margin-bottom: 15px;
    border: 2px solid var(--border-color); /* Delikatna ramka */
}

/* FOOTER (Stopka) */
.site-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* FORMULARZE */
.register-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-card {
    max-width: 500px;
    width: 100%;
    aspect-ratio: auto; /* Nadpisujemy kwadrat z karty, formularz musi być prostokątny */
    padding: 40px;
}

.form-card h2 {
    margin-bottom: 10px;
}

.form-card p {
    margin-bottom: 25px;
}

.custom-form {
    width: 100%;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.custom-form input,
.custom-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Minimalne zaokrąglenie */
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s;
}

.custom-form input:focus,
.custom-form textarea:focus {
    border-color: #a1a1aa; /* Ciemniejszy szary przy kliknięciu */
}

.custom-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--text-main); /* Ciemny przycisk */
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #3f3f46;
}

/* KLASY DLA PANELU TWÓRCY (DASHBOARD) */
#dashboard-nav {
    border-bottom: none;
    margin-bottom: 20px;
    padding: 0;
}
.status-active { color: #15803d; font-weight: bold; }
.status-pending { color: #b91c1c; font-weight: bold; }
.success-msg { color: #15803d; text-align: center; margin-bottom: 15px; }
.file-input { background: none !important; border: none !important; padding: 0 !important; margin-top: 10px; }

/* KAFELEK PREMIUM */
.premium-card {
    border: 2px solid #d4af37; /* Klasyczne złoto */
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2); /* Delikatna złota poświata */
}

/* SIATKA GALERII W DASHBOARDZIE */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dwie równe kolumny: lewo i prawo */
    gap: 15px;
    margin-top: 10px;
}
.upload-slot {
    border: 1px dashed var(--border-color);
    padding: 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.4);
}
.upload-slot.locked {
    opacity: 0.5; /* Wyszarzone */
    background: rgba(0, 0, 0, 0.05); /* Ciemniejsze tło */
}
.premium-badge {
    color: #d4af37; /* Złoty akcent */
    font-weight: bold;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* WIDOK PC DLA PANELU (Sticky + 2 Kolumny + 4 Kafelki) */
@media (min-width: 768px) {
    .dashboard-layout {
        display: flex;
        align-items: flex-start; /* Niezbędne, żeby sticky zadziałało */
        gap: 40px;
    }
    .dash-col-photos {
        flex: 1.5; /* Lewa kolumna (zdjęcia) zajmuje więcej miejsca */
    }
    .dash-col-text {
        flex: 1; /* Prawa kolumna (teksty) jest węższa */
        position: sticky;
        top: 20px; /* Przykleja się 20px od góry ekranu */
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 okienka w rzędzie na PC! */
    }
}

/* KARTA PANELU (Szeroka) */
.dashboard-card {
    max-width: 1000px; /* Dajemy jej wreszcie odetchnąć na PC! */
    width: 100%;
    padding: 40px;
    text-align: left; /* Wyrównanie do lewej */
}

/* WYSZUKIWARKA W MENU */
.search-form { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text-muted); }
.search-input { padding: 8px 15px 8px 35px; border: 1px solid var(--border-color); border-radius: 20px; background: rgba(255, 255, 255, 0.6); outline: none; width: 250px; font-size: 0.9rem; transition: all 0.3s ease; color: var(--text-main); }
.search-input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.05); width: 280px; }

/* Na małych ekranach (telefonach) zwężamy lupkę, żeby nie rozwaliła menu */
@media (max-width: 768px) {
    .search-input { width: 140px; }
    .search-input:focus { width: 160px; }
}

/* WIZYTÓWKA TWÓRCY - RESPONSOWNOŚĆ (Przerzucanie Avatara) */
.creator-layout {
    display: flex;
    flex-direction: column; /* Domyślnie (Tel) układ pionowy */
}
.creator-header { order: 1; margin-bottom: 20px; } /* Tel: Na samą górę! */
.creator-photos { order: 2; margin-bottom: 20px; } /* Tel: Zdjęcia pośrodku */
.creator-text   { order: 3; } /* Tel: Opis na samym dole */

.creator-right-col {
    /* Ten trik 'rozpuszcza' prawą kolumnę na telefonie, uwalniając Avatar i Opis, by mogły skakać góra/dół */
    display: contents; 
}

@media (min-width: 768px) {
    .creator-layout {
        flex-direction: row; /* PC: Układ obok siebie */
        align-items: flex-start;
        gap: 40px;
    }
    .creator-photos {
        flex: 1.5;
        order: 1;
        margin-bottom: 0;
    }
    .creator-right-col {
        display: block; /* PC: Zamykamy z powrotem w sztywną kolumnę */
        flex: 1;
        order: 2;
        position: sticky;
        top: 20px;
    }
    .creator-header { margin-bottom: 20px; } 
}

/* === WERSJA MOBILNA DLA STRONY GŁÓWNEJ (2 kafelki w rzędzie) === */
@media (max-width: 768px) {
    .grid {
        /* Przełamujemy ograniczenia i wymuszamy 2 równe kolumny */
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; /* Zmniejszamy dziury między kafelkami */
    }
    
    .card {
        padding: 15px 10px; /* Odchudzamy puste tło wewnątrz kafelka */
    }

    .card-img {
        width: 60px; /* Avatar musi być mniejszy na tel */
        height: 60px;
        margin-bottom: 10px;
    }

    .card h3 {
        font-size: 1rem; /* Tytuł ciut mniejszy */
    }

    .card p {
        font-size: 0.8rem;
        margin-bottom: 10px !important; /* Wymuszenie nadpisania starych marginesów */
    }

    .card .btn-submit {
        font-size: 0.75rem !important; 
        padding: 6px 5px !important; 
        width: 100% !important; /* Przycisk rozciąga się na całą dostępną szerokość małego kafelka */
    }
}

/* SEKCJA AVATARA I PROŚBA O PREMIUM (Wyczyszczony HTML) */
.avatar-actions-row { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.avatar-img-preview { margin: 0; }
.btn-logout-sm { width: auto; padding: 8px 20px; }
.avatar-upload-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.file-input-avatar { flex: 1; margin: 0; }

.premium-request-box {
    background: rgba(212, 175, 55, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}
.premium-status-locked { font-size: 0.8rem; color: #d4af37; font-weight: bold; opacity: 0.5; }
.premium-status-pending { font-size: 0.8rem; color: var(--text-muted); font-weight: bold; }
.premium-label-active { font-size: 0.8rem; font-weight: bold; margin: 0; cursor: pointer; color: var(--text-main); }
.checkbox-disabled { opacity: 0.5; cursor: not-allowed; }
.checkbox-active { cursor: pointer; }