/* static/css/styles.css */
/* Główne zmienne kolorystyczne */
:root {
    --dark-primary: #1a2e1a; /* ciemnozielony */
    --light-primary: #f8f9fa; /* jasny */
    --gold: #d4af37; /* złoty */
    --dark-text: #f5f5f5;
    --light-text: #212529;
    --dark-secondary: #0d1c0d;
    --light-secondary: #e9ecef;
    --dark-card: #142814;
    --light-card: #ffffff;
}

/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Motyw ciemny - domyślny */
body.dark-theme {
    background-color: var(--dark-primary);
    color: var(--dark-text);
}

body.dark-theme .navbar {
    background-color: var(--dark-secondary);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

body.dark-theme .card {
    background-color: var(--dark-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--dark-text);
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: var(--dark-card);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--dark-text);
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

body.dark-theme .auth-container {
    background-color: var(--dark-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

body.dark-theme footer {
    background-color: var(--dark-secondary);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

body.dark-theme .order-card {
    background-color: #142814;
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #f5f5f5;
}

body.dark-theme .order-card .card-header {
    background-color: #0d1c0d;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: #f5f5f5;
}

body.dark-theme .order-card .list-group-item {
    background-color: #1a2e1a;
    border: 1px solid rgba(212, 175, 55, 0.1);
    color: #f5f5f5;
}

body.dark-theme .order-card .list-group-item strong {
    color: #d4af37;
}

/* Motyw jasny */
body.light-theme {
    background-color: var(--light-primary);
    color: var(--light-text);
}

body.light-theme .navbar {
    background-color: var(--light-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .card {
    background-color: var(--light-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--light-text);
}

body.light-theme .form-control,
body.light-theme .form-select {
    background-color: var(--light-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--light-text);
}

body.light-theme .form-control:focus,
body.light-theme .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

body.light-theme .auth-container {
    background-color: var(--light-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme footer {
    background-color: var(--light-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Wspólne style dla obu motywów */
.navbar {
    padding: 1rem 0;
    transition: background-color 0.3s ease;
}

.navbar-brand {
    font-family: 'Old English Text MT', serif;
    font-size: 2rem;
    color: var(--gold) !important;
    letter-spacing: 1px;
}

.navbar-link {
    color: var(--gold) !important;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.navbar-link:hover {
    opacity: 0.8;
}

.btn {
    background-color: transparent;
    border: 2px solid var(--gold);
    color: var(--gold) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--gold);
    color: #fff !important;
}

.btn-add-to-cart {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-gothic {
    font-family: 'Old English Text MT', serif;
    letter-spacing: 1px;
}

.btn-outline-gothic {
    font-family: 'Old English Text MT', serif;
    letter-spacing: 1px;
    border: 2px solid var(--gold);
    color: var(--gold) !important;
}

.btn-outline-gothic:hover {
    background-color: var(--gold);
    color: #fff !important;
}

.card {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-img-top {
    height: 300px;
    object-fit: cover;
    width: 100%;
}

.auth-container {
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.text-gothic {
    font-family: 'Old English Text MT', serif;
    color: var(--gold);
}

footer {
    padding: 2rem 0;
    margin-top: auto;
}

footer a {
    color: var(--gold);
    text-decoration: none;
    margin: 0 1rem;
}

footer a:hover {
    text-decoration: underline;
}

.text-primary {
    color: var(--gold) !important;
}

.border-primary {
    border-color: var(--gold) !important;
}

/* Styl dla książek */
.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 kolumn */
    gap: 1.5rem;
}

.book-card {
    position: relative;
    overflow: hidden;
}

.book-cover-link {
    display: block;
    text-decoration: none;
}

.book-cover-container {
    position: relative;
    width: 100%;
    padding-top: 160%; /* 5:8 ratio (5/8=0.625 -> 1/0.625=1.6) */
    overflow: hidden;
}

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
}

.book-overlay h5 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.book-overlay p {
    margin-bottom: 0.25rem;
}

.book-overlay .price {
    font-weight: bold;
    color: #d4af37;
}

.book-cover-link:hover .book-overlay {
    opacity: 1;
}

.book-cover-link:hover .book-cover {
    transform: scale(1.05);
}

/* Responsywność */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .book-cover-container {
        padding-top: 140%; /* Slightly different ratio on mobile */
    }
}

/* Koszyk */
#cart-items .card {
    margin-bottom: 1.5rem;
}

.card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.decrease-btn, .increase-btn, .remove-btn {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.decrease-btn:hover, .increase-btn:hover, .remove-btn:hover {
    transform: scale(1.1);
}

.quantity-display {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

/* Animacje dla ilości */
.quantity-change {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Formularze */
.form-control, .form-select {
    border-radius: 0;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Responsywność */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .row.mb-4 {
        flex-direction: column;
        gap: 1rem;
    }
    
    .col-md-4, .col-md-5, .col-md-3 {
        width: 100%;
    }
}

/* Animacje spinnera */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
    color: var(--gold);
}

/* Alerty */
.alert {
    border-radius: 0;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

/* Ikony w koszyku */
.bi {
    vertical-align: middle;
}

/* Strona podziękowania */
.py-5 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

.display-3 {
    font-family: 'Old English Text MT', serif;
    margin-bottom: 2rem;
}

.lead {
    font-size: 1.5rem;
    margin-bottom: 3rem;
}

/* Układ dla strony profilu */
#order-history .card {
    margin-bottom: 1.5rem;
}
