/* ========================================================================
   UTILITY CLASSES - Consolidate Repeated Inline Styles
   ========================================================================

   These classes replace common inline style patterns found throughout
   the codebase. Use these instead of inline styles to improve:
   - Maintainability
   - Consistency
   - Page load performance
   - Developer experience

   Created from audit of 53+ inline style instances
   ======================================================================= */

/* ========================================================================
   SPACING UTILITIES
   ======================================================================= */

/* Section padding - used 4+ times in homepage */
.section-padding {
    padding: 80px 0;
}

.section-padding-sm {
    padding: 40px 0;
}

.section-padding-lg {
    padding: 100px 0;
}

.margin-top-lg {
    margin-top: 60px;
}

.margin-top-md {
    margin-top: 20px;
}

.margin-bottom-lg {
    margin-bottom: 30px;
}

.margin-bottom-md {
    margin-bottom: 10px;
}

.margin-auto {
    margin: 0 auto;
}

/* ========================================================================
   BORDER & SHADOW UTILITIES
   ======================================================================= */

/* Card shadow - primary style (used 2+ times) */
.card-shadow {
    box-shadow: var(--shadow-card);
}

/* Enhanced shadow for modals/overlays */
.shadow-lg {
    box-shadow: var(--shadow-modal);
}

/* Rounded corner standard (used 3+ times) */
.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-full {
    border-radius: var(--radius-pill);
}

/* Standard border styling */
.border-primary {
    border: 1px solid var(--color-border);
}

.border-overlay {
    overflow: hidden;
}

/* ========================================================================
   IMAGE & MEDIA UTILITIES
   ======================================================================= */

/* Image cover pattern - used 4+ times */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.img-full-width {
    width: 100%;
    display: block;
}

.aspect-video {
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

/* ========================================================================
   TEXT UTILITIES
   ======================================================================= */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-white {
    color: white;
}

.text-white-muted {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.text-error {
    color: var(--color-danger);
}

.text-success {
    color: var(--color-success);
}

/* ========================================================================
   LAYOUT UTILITIES
   ======================================================================= */

.max-width-lg {
    max-width: 800px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.gap-lg {
    gap: 30px;
}

.icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ========================================================================
   BACKGROUND UTILITIES
   ======================================================================= */

.bg-light {
    background: var(--color-bg-light);
}

.bg-light-blue {
    background: var(--color-bg-light-blue);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
}

.bg-gradient-light {
    background: linear-gradient(
        rgba(248, 250, 252, 0.92),
        rgba(248, 250, 252, 0.92)
    ),
    url('../image/home/sfondo-disegno-tecnico.webp') center/cover fixed;
}

.bg-cover-fixed {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

/* ========================================================================
   DISPLAY UTILITIES
   ======================================================================= */

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* Auth buttons - inline display */
.auth-btn {
    display: inline-block;
}

.auth-btn.hidden {
    display: none;
}

.flex-display {
    display: flex;
}

.inline-block {
    display: inline-block;
}

/* ========================================================================
   BUTTON & INTERACTIVE UTILITIES
   ======================================================================= */

.btn-full-width {
    width: 100%;
}

.btn-with-margin {
    margin-top: 20px;
}

/* ========================================================================
   COMPONENT-SPECIFIC UTILITIES
   ======================================================================= */

/* Delete Account Modal Styles */
.delete-step-container {
    text-align: center;
    padding: 2rem 0;
}

.delete-step-icon {
    font-size: 80px;
    margin-bottom: 1rem;
}

.delete-step-icon.success {
    color: var(--color-success);
}

.delete-step-icon.error {
    color: var(--color-danger);
}

.delete-step-message {
    color: var(--color-success);
    margin-bottom: 1rem;
}

.delete-step-message.error {
    color: var(--color-danger);
}

.delete-stats-box {
    background: var(--color-bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.delete-stats-item {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.delete-step-subtitle {
    color: #6c757d;
    margin-bottom: 1rem;
}

.delete-step-footer {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ========================================================================
   MODAL & OVERLAY UTILITIES
   ======================================================================= */

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.modal-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* ========================================================================
   ANIMATION & TRANSITION UTILITIES
   ======================================================================= */

.transition-transform {
    transition: transform 0.4s ease;
}

.transition-all {
    transition: all 0.3s ease;
}

/* ========================================================================
   RESPONSIVE UTILITIES
   ======================================================================= */

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 40px 0;
    }

    .grid-3-col {
        grid-template-columns: 1fr;
    }

    .text-center {
        text-align: center;
    }
}

/* ========================================================================
   NOTIFICATION UTILITIES
   ======================================================================= */

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    color: white;
    border-radius: var(--radius-md);
    z-index: var(--z-modal);
    box-shadow: var(--shadow-md);
    font-family: var(--font-primary);
    font-size: 14px;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.notification-error {
    background: var(--color-danger);
}

.notification-success {
    background: var(--color-success);
}

.notification-warning {
    background: var(--color-warning);
}

.notification-info {
    background: var(--color-info);
}

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

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

.notification.hide {
    animation: slideOutRight 0.3s ease forwards;
}

/* ========================================================================
   ACCESSIBILITY UTILITIES
   ======================================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus-visible {
    outline: 2px solid #2d5a87;
    outline-offset: 2px;
}

/* ========================================================================
   MIGRATION GUIDE
   ========================================================================

   BEFORE (Inline styles):
   ────────────────────────
   <section style="padding: 80px 0; text-align: center;">
       <h2 style="text-align: center; margin-top: 60px; margin-bottom: 10px;">
       <p style="color: #6b7280; margin-bottom: 30px;">
   </section>

   AFTER (Utility classes):
   ────────────────────────
   <section class="section-padding text-center">
       <h2 class="margin-top-lg margin-bottom-md">
       <p class="text-muted margin-bottom-lg">
   </section>

   ======================================================================= */
