/**
 * San Marino Photo Cosplay - Custom Styles
 * 
 * Customizzazioni Bootstrap 5 e stili specifici del sito.
 * Questo file consolida tutti gli stili custom precedentemente sparsi
 * in app.css e v5/extra.css
 * 
 * Organizzazione:
 * 1. Variabili CSS (Brand colors, spacing, etc.)
 * 2. Layout globale
 * 3. Componenti custom
 * 4. Cards & Animazioni
 * 5. Buttons & Forms
 * 6. Badges & Progress
 * 7. Carousel
 * 8. Brand Colors
 * 9. Text Utilities
 * 10. Pagination
 * 11. Utilities & Helper Classes
 * 12. Responsive Adjustments
 */


/* ==========================================
   1. VARIABILI CSS (Brand Colors & Settings)
   ========================================== */

:root {
  /* Brand Colors */
  --smpc-primary: #4897c9;        /* Azzurro San Marino Photo Cosplay */
  --smpc-primary-hover: #3a7ba8;  /* Azzurro più scuro per hover */
  --smpc-primary-light: #6bb3db;  /* Azzurro più chiaro */
  --smpc-dark: #1d2124;           /* Grigio scuro per contrasto */
  
  /* Gradients SMPC */
  --smpc-gradient: linear-gradient(135deg, #4897c9 0%, #6bb3db 100%);
  --smpc-gradient-reverse: linear-gradient(135deg, #6bb3db 0%, #4897c9 100%);
  
  /* Success Gradient (per bottoni submit) */
  --smpc-success-gradient: linear-gradient(135deg, #198754 0%, #20c997 100%);
  --smpc-success-gradient-hover: linear-gradient(135deg, #146c43 0%, #0dcaf0 100%);
  
  /* Layout */
  --smpc-navbar-height: 80px;
  
  /* Spacing */
  --smpc-section-spacing: 3rem;
  
  /* Transitions */
  --smpc-transition-fast: 0.2s ease;
  --smpc-transition-normal: 0.3s ease;
}


/* ==========================================
   2. LAYOUT GLOBALE
   ========================================== */

/**
 * Padding per compensare la navbar fixed-top
 */
body {
  padding-top: var(--smpc-navbar-height);
}

/**
 * Logo navbar - limita altezza
 */
.navbar-brand img {
    max-height: 55px;  /* Altezza massima logo */
    width: auto;
    transition: max-height 0.3s;
}

/**
 * Navbar height control
 */
.navbar {
    min-height: var(--smpc-navbar-height);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/**
 * considera altezza navbar
 */
.flash-message {
    margin-top: var(--smpc-navbar-height);
    margin-bottom: 0;
    border-radius: 0;
    position: relative;
    z-index: 1040;
}


/* ==========================================
   3. COMPONENTI CUSTOM
   ========================================== */

/**
 * Feature icon container
 * Usato per icone quadrate/circolari centrate
 */
.feature {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  font-size: 1.5rem;
}

/**
 * Feature icon large (per header importanti)
 */
.feature-lg {
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
}

/**
 * Background per blog cards con immagine
 */
.bg-featured-blog {
  height: 100%;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 15rem;
}

/**
 * Portfolio item container
 */
.portfolio-item {
  margin-bottom: 30px;
}

/**
 * Toast notification container
 */
.toast-container {
  --bs-toast-zindex: 1090;
  position: absolute;
  z-index: var(--bs-toast-zindex);
  width: max-content;
  max-width: 100%;
  pointer-events: none;
}

/**
 * File upload button styling
 */
::-webkit-file-upload-button {
  font: inherit;
  -webkit-appearance: button;
}

/**
 * Breadcrumb 
 */
.breadcrumb-wrapper {
    background-color: rgba(72, 151, 201, 0.06);
    border-bottom: 2px solid var(--smpc-primary);
    margin-left: -15px;   /* Compensa padding container */
    margin-right: -15px;  /* Compensa padding container */
    margin-bottom: 2rem;
    padding: 0.75rem 15px;
    
}

/* Breadcrumb list */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin: 0;
}

/* Separatore */
.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--smpc-primary);
    padding: 0 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Link */
.breadcrumb-item a {
    color: var(--smpc-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--smpc-transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--smpc-primary-hover);
    text-decoration: underline;
}

/* Elemento attivo (pagina corrente) */
.breadcrumb-item.active {
    color: #495057;
    font-weight: 400;
}


/* ==========================================
   4. CARDS & ANIMAZIONI
   ========================================== */

/**
 * Card base con shadow e animazioni
 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform var(--smpc-transition-fast), 
                box-shadow var(--smpc-transition-fast);
}

/**
 * Card hover effect (subtle lift)
 */
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/**
 * Card body padding
 */
.card-body {
    padding: 1.5rem;
}

/**
 * Card header con colori SMC (senza bordi)
 */
.card-header.bg-smc,
.card-header.bg-smc-grad {
    border: none;
}

/**
 * Card con shadow più pronunciata
 */
.card.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


/* ==========================================
   5. BUTTONS & FORMS
   ========================================== */

/**
 * Button base con animazione
 */
.btn {
    transition: all var(--smpc-transition-fast);
}

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

/**
 * Button Success con gradient (per submit forms)
 */
.btn-success {
    background: var(--smpc-success-gradient);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
    transition: all var(--smpc-transition-normal);
}

.btn-success:hover {
    background: var(--smpc-success-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4);
    color: white;
}

.btn-success:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/**
 * Form Floating Labels
 */
.form-floating > .form-control,
.form-floating > .form-select {
    border: 2px solid #e0e0e0;
    transition: all var(--smpc-transition-normal);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--smpc-primary);
    box-shadow: 0 0 0 0.25rem rgba(72, 151, 201, 0.15);
}

/**
 * Textarea styling
 */
textarea.form-control {
    border: 2px solid #e0e0e0;
    transition: all var(--smpc-transition-normal);
}

textarea.form-control:focus {
    border-color: var(--smpc-primary);
    box-shadow: 0 0 0 0.25rem rgba(72, 151, 201, 0.15);
}

/**
 * Radio Button Cards (per scelte multiple visive)
 */
.btn-check:checked + .btn-outline-primary {
    background-color: var(--smpc-primary);
    border-color: var(--smpc-primary);
    color: white;
}

.btn-outline-primary {
    border-width: 2px;
    transition: all var(--smpc-transition-normal);
}

.btn-outline-primary:hover {
    background-color: var(--smpc-primary);
    border-color: var(--smpc-primary);
    transform: translateX(4px);
}

/**
 * Input Group
 */
.input-group-text {
    border: 2px solid #e0e0e0;
}

.input-group > .form-control:focus {
    border-color: var(--smpc-primary);
    box-shadow: none;
}

.input-group > .form-control:focus ~ .input-group-text {
    border-color: var(--smpc-primary);
}

/**
 * Form errors styling
 */
.invalid-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}


/* ==========================================
   6. BADGES & PROGRESS
   ========================================== */

/**
 * Badge styling migliorato
 */
.badge {
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.5rem 1rem;
}

/**
 * Progress bar con colori SMC
 */
.progress {
    background-color: #e9ecef;
    border-radius: 0.5rem;
}

.progress-bar {
    background-color: var(--smpc-primary);
}

.progress-bar.bg-smc {
    background-color: var(--smpc-primary);
}


/* ==========================================
   7. CAROUSEL
   ========================================== */

/**
 * Carousel item con background image
 */
.carousel-item {
  height: auto;
  min-height: 300px;
  background: no-repeat center center scroll;
  background-size: cover;
}

/**
 * Force carousel images to be 100% width
 */
.carousel-item .img-fluid {
  width: 100%;
  height: auto;
}


/* ==========================================
   8. BRAND COLORS - Background & Buttons
   ========================================== */

/**
 * Background color principale SMPC
 */
.bg-smc {
  background-color: var(--smpc-primary) !important;
}

.bg-smc-grad {
  background: var(--smpc-gradient) !important;
}

/**
 * Hover states per link e bottoni con bg-smc
 */
a.bg-smc:hover,
a.bg-smc:focus,
button.bg-smc:hover,
button.bg-smc:focus {
  background-color: var(--smpc-dark) !important;
}

/**
 * Bottone brand primario
 */
.btn-smc {
  background-color: var(--smpc-primary);
  border-color: var(--smpc-primary);
  color: white;
}

.btn-smc:hover,
.btn-smc:focus {
  background-color: var(--smpc-primary-hover);
  border-color: var(--smpc-primary-hover);
  color: white;
}

/**
 * Bottone brand outline
 */
.btn-outline-smc {
  border-color: var(--smpc-primary);
  color: var(--smpc-primary);
  background-color: transparent;
}

.btn-outline-smc:hover,
.btn-outline-smc:focus {
  background-color: var(--smpc-primary);
  border-color: var(--smpc-primary);
  color: white;
}


/* ==========================================
   9. TEXT UTILITIES
   ========================================== */

/**
 * Text color brand
 */
.text-smc {
  color: var(--smpc-primary) !important;
}

.text-smc-dark {
  color: var(--smpc-dark) !important;
}

/**
 * Override Bootstrap text-primary con colore SMC
 */
.text-primary {
  color: var(--smpc-primary) !important;
}


/* ==========================================
   10. KNP PAGINATION - SMPC STYLE
   ========================================== */

.pagination {
    margin: 1.5rem 0;
}

.pagination .page-item.active .page-link {
    background-color: var(--smpc-primary);
    border-color: var(--smpc-primary);
    color: white;
}

.pagination .page-link {
    color: var(--smpc-primary);
    transition: all var(--smpc-transition-fast);
}

.pagination .page-link:hover:not(.active) {
    background-color: rgba(72, 151, 201, 0.1);
    border-color: var(--smpc-primary);
    color: var(--smpc-primary-hover);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/**
 * Sortable links con icone
 */
a.sortable {
    color: var(--smpc-primary);
    text-decoration: none;
    transition: color var(--smpc-transition-fast);
}

a.sortable:hover {
    color: var(--smpc-primary-hover);
}

a.sortable.sorted {
    font-weight: 600;
}


/* ==========================================
   11. UTILITIES & HELPER CLASSES
   ========================================== */

/**
 * Border utilities
 */
.smc-borderless {
  border: none !important;
}

.border-5 {
  border-width: 5px !important;
}

/**
 * Link utilities
 */
a {
    transition: color var(--smpc-transition-fast);
}

/**
 * Modal styling
 */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
}

/**
 * Alert styling
 */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/**
 * Empty state utilities
 */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}


/* ==========================================
   12. RESPONSIVE ADJUSTMENTS
   ========================================== */

/**
 * Mobile: riduci padding navbar se necessario
 */
@media (max-width: 768px) {
  body {
    padding-top: calc(var(--smpc-navbar-height) - 6px);
  }
  
  /**
   * Card padding ridotto su mobile
   */
  .card-body {
    padding: 1rem;
  }
  
  /**
   * Feature icon ridotta su mobile
   */
  .feature-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
  }
  
  /**
   * Badge padding ridotto
   */
  .badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
}

/**
 * Tablet adjustments
 */
@media (min-width: 768px) and (max-width: 992px) {
  .feature-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.75rem;
  }
}


/* ==========================================
   13. PRINT STYLES (opzionale)
   ========================================== */

@media print {
  .navbar,
  .breadcrumb-wrapper,
  .btn,
  .flash-message {
    display: none !important;
  }
  
  body {
    padding-top: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
}


/* ==========================================
   14. ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/**
 * Focus visible per navigazione da tastiera
 */
*:focus-visible {
    outline: 2px solid var(--smpc-primary);
    outline-offset: 2px;
}

/**
 * Skip to content link (nascosto fino a focus)
 */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--smpc-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* In custom.css - Sezione "Upload & File Management" */

/* Drop Zone Base (riusabile per qualsiasi upload) */
.drop-zone,
.single-drop-zone {
    border: 3px dashed var(--smpc-border-light, #dee2e6);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.drop-zone:hover,
.single-drop-zone:hover {
    border-color: var(--smpc-primary, #4897c9);
    background: linear-gradient(135deg, #e7f3ff 0%, #cfe2ff 100%);
    transform: scale(1.01);
}

.drop-zone.drag-over,
.single-drop-zone.drag-over {
    border-color: var(--smpc-primary, #4897c9);
    box-shadow: 0 8px 24px rgba(72, 151, 201, 0.2);
}

/* Preview Grid (riusabile per gallerie) */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Utility per alert toast (già usato altrove?) */
.alert-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   15. DARK MODE READY (future implementation)
   ========================================== */

/**
 * Preparazione per dark mode
 * Decommentare quando necessario
 */

/*
@media (prefers-color-scheme: dark) {
  :root {
    --smpc-primary: #6bb3db;
    --smpc-primary-hover: #8cc4e5;
  }
  
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  
  .card {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }
}
*/
