/**
 * Estilos públicos para Sears Wedding Registry
 * Version: 1.0.0
 */

/* === Variables CSS - Tema Sears === */
:root {
    --swr-primary: #003b71;        /* Azul marino Sears */
    --swr-secondary: #00509e;      /* Azul secundario */
    --swr-success: #28a745;
    --swr-danger: #dc3545;
    --swr-warning: #ffc107;
    --swr-info: #17a2b8;
    --swr-light: #f8f9fa;
    --swr-dark: #212529;
    --swr-border: #dee2e6;
    --swr-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --swr-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Enlace al Dashboard en el Menú === */
.menu-item-wedding-dashboard,
.menu-item-wedding-dropdown,
.menu-item-club-bodas,
.menu-item-eventos,
.menu-item-create-event {
    position: relative;
}

/* Dashboard link (usuario logueado con evento activo) */
.wedding-dashboard-link,
.wedding-dropdown-toggle,
.wedding-create-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #003b71 0%, #00509e 100%) !important;
    color: white !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 59, 113, 0.3);
}

.wedding-dashboard-link:hover {
    background: linear-gradient(135deg, #00509e 0%, #003b71 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 59, 113, 0.4);
    color: white !important;
}

/* Nav links para no logueados (Club de Bodas / Eventos) */
.wedding-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.wedding-nav-link--bodas {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.wedding-nav-link--bodas:hover {
    background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    color: white !important;
}

.wedding-nav-link--eventos {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.wedding-nav-link--eventos:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    color: white !important;
}

.wedding-icon {
    font-size: 1.1em;
    line-height: 1;
}

/* === Campos de Contraseña con Toggle === */
.swr-password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.swr-password-field input[type="password"],
.swr-password-field input[type="text"] {
    padding-right: 48px !important;
    width: 100%;
}

.swr-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.swr-toggle-password:hover {
    opacity: 1;
}

/* === Medidor de Fortaleza de Contraseña === */
.swr-password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.swr-strength-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.swr-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
}

.swr-strength-label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
}

/* === Indicador de Coincidencia de Contraseña === */
.swr-password-match {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
}

.swr-password-match.swr-match {
    color: #28a745;
}

.swr-password-match.swr-no-match {
    color: #dc3545;
}

/* === Header del Formulario - Club de Bodas === */
.swr-form-header--bodas {
    text-align: center;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.swr-form-header-badge {
    display: inline-block;
    background: #e91e63;
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.swr-form-header--bodas h1 {
    color: #880e4f;
    margin: 0 0 10px;
}

.swr-form-header--bodas p {
    color: #FFFFFF;
    margin: 0;
    font-weight: 500;
}

/* === Form page: asegurar que el contenido quede debajo del header del tema === */
.swr-wedding-form-page .swr-container {
    padding-top: 100px;
    position: relative;
    z-index: 1;
}

/* === Layout General === */
.swr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.swr-wedding-page,
.swr-couple-dashboard,
.swr-wedding-form-page {
    font-family: var(--swr-font-family);
    color: var(--swr-dark);
    background: white;
}

/* === Hero Section === */
.swr-hero-section {
    position: relative;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-color: var(--swr-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.swr-hero-overlay {
    background: rgba(255, 255, 255, 0.92);
    color: #003b71;
    padding: 60px 40px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Cuando usa gradiente de colores en lugar de imagen */
.swr-hero-section.no-image .swr-hero-overlay {
    background: rgba(255, 255, 255, 0.85);
}

.swr-couple-names {
    font-size: 3rem;
    margin: 0 0 15px;
    font-weight: 700;
    text-shadow: none;
    line-height: 1.2;
    color: #003b71;
}

.swr-event-date {
    font-size: 1.5rem;
    margin: 10px 0;
    text-shadow: none;
    color: #444;
}

.swr-event-location {
    font-size: 1.2rem;
    margin: 10px 0;
    text-shadow: none;
    color: #555;
}

/* === Countdown === */
.swr-countdown-section {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid var(--swr-border);
}

.swr-countdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.countdown-item {
    text-align: center;
    min-width: 100px;
}

.countdown-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--swr-primary);
}

.countdown-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    margin-top: 5px;
}

/* === Welcome Section === */
.swr-welcome-section {
    padding: 60px 0;
    background: var(--swr-light);
}

.swr-welcome-message {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
}

/* === Progress Bar === */
.swr-progress-section {
    padding: 40px 0;
    background: white;
}

.swr-progress-section h3 {
    text-align: center;
    margin-bottom: 20px;
}

.swr-progress-bar {
    height: 40px;
    background: var(--swr-light);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.swr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--swr-primary), var(--swr-secondary));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.swr-progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
}

/* === Products Grid === */
.swr-products-section {
    padding: 60px 0;
    background: var(--swr-light);
}

.swr-products-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: var(--swr-dark);
}

.swr-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.swr-product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--swr-border);
    transition: all 0.3s ease;
}

.swr-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 59, 113, 0.15);
    border-color: var(--swr-primary);
}

.swr-product-image {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
}

.swr-product-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swr-priority-badge {
    display: inline-block;
    background: var(--swr-warning);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.swr-product-details {
    padding: 20px;
}

.swr-product-name {
    font-size: 1.1rem;
    margin: 0 0 10px;
    color: var(--swr-dark);
}

.swr-product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--swr-primary);
    margin: 10px 0;
}

.swr-product-availability {
    margin: 10px 0;
}

.swr-available-badge {
    display: inline-block;
    background: var(--swr-success);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.swr-product-notes {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}

/* === Botones - Estilo Sears === */
.swr-button {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swr-button-primary {
    background: var(--swr-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 59, 113, 0.2);
}

.swr-button-primary:hover {
    background: var(--swr-secondary);
    box-shadow: 0 4px 12px rgba(0, 59, 113, 0.3);
    transform: translateY(-1px);
    color: white;
}

.swr-button-secondary {
    background: white;
    color: var(--swr-primary);
    border: 2px solid var(--swr-primary);
}

.swr-button-secondary:hover {
    background: var(--swr-primary);
    color: white;
}

/* === Share Section === */
.swr-share-section {
    padding: 60px 0;
    background: white;
    text-align: center;
}

.swr-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.swr-share-btn {
    padding: 12px 24px;
    border: 2px solid var(--swr-border);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swr-share-btn:hover {
    background: var(--swr-primary);
    color: white;
    border-color: var(--swr-primary);
}

/* === Dashboard === */
.swr-couple-dashboard {
    padding: 20px;
}

.swr-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.swr-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.swr-stat-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--swr-shadow);
    text-align: center;
}

.swr-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--swr-primary);
    margin-bottom: 10px;
}

.swr-stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
}

/* === Tabs === */
.swr-dashboard-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--swr-border);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.swr-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.swr-tab.active {
    color: var(--swr-primary);
    border-bottom-color: var(--swr-primary);
}

.swr-tab-content {
    display: none;
}

.swr-tab-content.active {
    display: block;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    /* Hero section responsive */
    .swr-hero-section {
        min-height: 400px;
    }

    .swr-hero-overlay {
        padding: 40px 20px;
        /* Asegurar que el overlay no overflow en móvil */
        max-width: 100%;
        box-sizing: border-box;
        /* Fondo más opaco para mejor legibilidad */
        background: rgba(0, 0, 0, 0.6);
    }

    .swr-couple-names {
        font-size: 1.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .swr-event-date {
        font-size: 1rem;
    }

    .swr-event-location {
        font-size: 1rem;
    }

    .swr-event-type-label {
        font-size: 14px !important;
    }

    .countdown-value {
        font-size: 2rem;
    }

    .swr-products-grid {
        grid-template-columns: 1fr;
    }

    .swr-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .swr-stats-overview {
        grid-template-columns: 1fr;
    }

    .swr-dashboard-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .swr-dashboard-tabs .swr-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .swr-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .swr-stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Image Upload Styles === */
.swr-image-upload-wrapper {
    position: relative;
}

.swr-image-upload-wrapper input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--swr-border);
    border-radius: 8px;
    background: var(--swr-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.swr-image-upload-wrapper input[type="file"]:hover {
    border-color: var(--swr-primary);
    background: white;
}

.swr-image-preview {
    position: relative;
    margin-top: 15px;
    border: 2px solid var(--swr-border);
    border-radius: 8px;
    overflow: hidden;
    max-width: 600px;
}

.swr-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.swr-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.swr-remove-image:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* === Form Styles === */
.swr-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--swr-primary) 0%, var(--swr-secondary) 100%);
    color: white;
    border-radius: 12px;
}

.swr-form-header h1 {
    margin: 0 0 10px;
    font-size: 2.5rem;
    color: white;
}

.swr-form-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.swr-form-section {
    background: white;
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: var(--swr-shadow);
    border: 1px solid var(--swr-border);
}

.swr-form-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--swr-primary);
    color: var(--swr-primary);
    font-size: 1.5rem;
}

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

.swr-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--swr-dark);
}

.swr-form-group input[type="text"],
.swr-form-group input[type="email"],
.swr-form-group input[type="password"],
.swr-form-group input[type="tel"],
.swr-form-group input[type="date"],
.swr-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--swr-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.swr-form-group input:focus,
.swr-form-group textarea:focus {
    outline: none;
    border-color: var(--swr-primary);
    box-shadow: 0 0 0 3px rgba(0, 59, 113, 0.1);
}

/* === Quantity Notice Message === */
.swr-qty-notice {
    color: #dc3545;
    font-weight: bold;
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 4px solid #dc3545;
    background: #fff5f5;
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.swr-form-group small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 0.875rem;
}

.swr-form-actions {
    text-align: center;
    margin-top: 30px;
}

.swr-form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.swr-form-messages p {
    margin: 0;
}

.swr-form-messages .success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.swr-form-messages .error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* === Dropdown de Múltiples Eventos === */
.menu-item-wedding-dropdown {
    position: relative;
}

.wedding-dropdown-toggle {
    text-decoration: none;
    cursor: pointer;
    color: #003b71;
    font-weight: 600;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wedding-dropdown-toggle:hover {
    color: #00509e;
}

.menu-item-wedding-dropdown .sub-menu {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 8px;
    padding: 8px 0;
    list-style: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    z-index: 100;
}

.menu-item-wedding-dropdown .sub-menu li {
    margin: 0;
}

.menu-item-wedding-dropdown .sub-menu a {
    display: block;
    padding: 12px 20px;
    color: #003b71;
    text-decoration: none;
    transition: background 200ms;
}

.menu-item-wedding-dropdown .sub-menu a:hover {
    background: #f0f4f8;
    color: #00509e;
}

/* === Crear Otro Evento Link === */
.menu-item-create-event a {
    text-decoration: none;
    color: #00a86b;
    font-weight: 600;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-item-create-event a:hover {
    color: #007d52;
}

/* === Account Selector Buttons === */
.swr-account-btn {
    background: white;
    border: 2px solid #dee2e6;
    color: #666;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.swr-account-btn:hover {
    border-color: #003b71;
    color: #003b71;
    background: #f5f8fb;
}

.swr-account-btn--login {
    border-color: #1976d2;
}

.swr-account-btn--register {
    border-color: #00a86b;
}

.swr-account-btn--active {
    background: #003b71;
    color: white;
    border-color: #003b71;
}

.swr-account-btn--active:hover {
    background: #00509e;
    border-color: #00509e;
}

/* === Login Section Styles === */
#swr-login-section .swr-form-group {
    margin-bottom: 15px;
}

#swr-login-section label {
    display: block;
    font-weight: 600;
    color: #003b71;
    margin-bottom: 8px;
}

#swr-login-section input {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* === Register Section === */
#swr-register-section {
    animation: fadeIn 300ms ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
