/* 
 * MenoGrace Components CSS
 * Reusable UI components and interactive elements
 * Version: 1.0.0
 */

/* ===================================================
   ACCESSIBILITY
   =================================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-dark);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius);
    text-decoration: none;
    z-index: 1000;
    font-weight: 500;
}

.skip-link:focus {
    top: 6px;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: var(--space-12) 0 var(--space-6);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.footer-logo {
    width: 80px;
    height: auto;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: var(--space-2);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--accent-warm);
}

.footer-disclaimer {
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer responsive layout */
@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    
    .footer-links {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-min);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button */
.btn--primary {
    background: var(--accent-warm);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover,
.btn--primary:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn--secondary {
    background: transparent;
    color: var(--accent-warm);
    border: 2px solid var(--accent-warm);
}

.btn--secondary:hover,
.btn--secondary:focus {
    background: var(--accent-warm);
    color: white;
}

/* Large Button */
.btn--lg {
    min-width: 280px;
    padding: var(--space-4) var(--space-8);
    font-size: 1.125rem;
}

/* Success Button */
.btn--success {
    background: var(--success);
    color: white;
}

/* Warning Button */
.btn--warning {
    background: var(--warning);
    color: white;
}

/* Disabled Button */
.btn--disabled {
    background: #999;
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===================================================
   CARDS
   =================================================== */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(200, 168, 130, 0.25);
}

.card__header {
    margin-bottom: var(--space-6);
}

.card__title {
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.card__content {
    color: var(--text-secondary);
}

/* Card Variants */
.card--highlight {
    border-color: var(--accent-warm);
    background: linear-gradient(135deg, 
        rgba(248, 244, 240, 1) 0%, 
        rgba(232, 221, 212, 0.3) 100%);
}

.card--premium {
    border: 2px solid var(--accent-warm);
    position: relative;
    transform: scale(1.02);
}

.card--testimonial {
    border-left: 4px solid var(--accent-warm);
    background: linear-gradient(135deg, #F8F4F0, #E8DDD4);
}

/* ===================================================
   BADGES & LABELS
   =================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

.badge--success {
    background: var(--success);
    color: white;
}

.badge--warning {
    background: var(--warning);
    color: white;
}

.badge--primary {
    background: var(--accent-warm);
    color: white;
}

.badge--outline {
    background: transparent;
    border: 2px solid var(--accent-warm);
    color: var(--accent-warm);
}

.badge--lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
}

/* ===================================================
   FORMS
   =================================================== */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-warm);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ===================================================
   PROGRESS INDICATORS
   =================================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-warm), #E8B570);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

/* ===================================================
   MEDIA COMPONENTS
   =================================================== */
.audio-player {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: linear-gradient(135deg, #F8F4F0, #E8DDD4);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-6);
}

.audio-player__button {
    background: var(--accent-warm);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.audio-player__button:hover {
    transform: scale(1.1);
}

.audio-player__info {
    color: var(--accent-warm);
    font-weight: 500;
}

/* ===================================================
   MODAL & OVERLAY
   =================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 27, 71, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.is-open .modal {
    transform: scale(1);
}

/* ===================================================
   ANIMATIONS
   =================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-up {
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.slide-up.is-visible {
    transform: translateY(0);
}

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ===================================================
   LOADING STATES
   =================================================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--accent-warm);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================
   RESPONSIVE HELPERS
   =================================================== */
@media (max-width: 768px) {
    .btn--lg {
        min-width: 100%;
        font-size: 1rem;
    }
    
    .card {
        padding: var(--space-6);
    }
    
    .modal {
        padding: var(--space-6);
        margin: var(--space-4);
    }
}

/* Touch device optimizations */
.touch-device .btn {
    min-height: var(--touch-min);
}

.touch-device .form-input {
    min-height: var(--touch-min);
}

/* ===================================================
   COOKIE BANNER (PERSUASIVE DESIGN)
   =================================================== */
.cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 550px;
    margin: 0 auto;
    background: white;
    color: #4A2F22;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 12px 40px rgba(44, 27, 71, 0.15);
    z-index: 1001;
    border-radius: 16px;
    border: 1px solid rgba(200, 168, 130, 0.25);
    transform: translateY(calc(100% + 2rem));
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.cookie-banner.show-prefs .cookie-content {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    visibility: hidden;
}

.cookie-text p {
    margin: 0;
    font-size: 0.95rem;
}

.cookie-text p:first-child {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.cookie-link {
    color: #C8A882;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    align-items: center;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#cookie-accept {
    background: #C8A882;
    color: white;
    box-shadow: 0 6px 18px rgba(200, 168, 130, 0.3);
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

#cookie-accept:hover {
    background: #D4B896;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 168, 130, 0.4);
}

#cookie-decline {
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
    font-weight: 500;
    padding-left: 1rem;
    padding-right: 1rem;
}

#cookie-decline:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

#cookie-save {
    line-height: 1.25;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

/* Preferences Panel */
.cookie-prefs {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
}

.cookie-banner.show-prefs .cookie-prefs {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.prefs-row {
    margin: 0.75rem 0;
    color: #4A2F22;
}

.prefs-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.prefs-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.prefs-note {
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    text-align: center;
}

@media (max-width: 550px) {
    .cookie-banner {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem 1rem calc(1rem + env(safe-area-inset-bottom));
        max-width: 100%;
        border-left: none;
        border-right: none;
    }

    .cookie-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    .cookie-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .cookie-btn {
        padding: 0.9rem 1.5rem;
        min-height: 48px;
    }
    .cookie-prefs {
        padding: 1.5rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }
}