/**
 * Breya Subscribe - Styles Frontend
 * Version: 1.0.0
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --breya-primary: #2271b1;
    --breya-success: #00a32a;
    --breya-error: #d63638;
    --breya-text: #333;
    --breya-border: #ddd;
    --breya-bg: #f9f9f9;
}

/* ==========================================================================
   Formulaire Inline
   ========================================================================== */
.breya-subscribe-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.breya-form-header h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: var(--breya-text);
    text-align: center;
}

.breya-form-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breya-form-row {
    width: 100%;
}

.breya-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--breya-border);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.breya-input:focus {
    outline: none;
    border-color: var(--breya-primary);
}

.breya-button {
    width: 100%;
    padding: 12px 20px;
    background: var(--breya-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.breya-button:hover {
    background: #135e96;
}

.breya-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Formulaire Minimal
   ========================================================================== */
.breya-form-minimal {
    max-width: 500px;
    padding: 15px;
}

.breya-form-inline-fields {
    display: flex;
    gap: 10px;
}

.breya-form-inline-fields .breya-input {
    flex: 1;
}

.breya-form-inline-fields .breya-button {
    width: auto;
    padding: 12px 30px;
    white-space: nowrap;
}

/* ==========================================================================
   Messages
   ========================================================================== */
.breya-form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

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

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

/* ==========================================================================
   Footer Bar
   ========================================================================== */
.breya-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--breya-primary);
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.breya-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.breya-footer-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.breya-footer-form {
    display: flex;
    gap: 10px;
}

.breya-footer-input {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    min-width: 250px;
}

.breya-footer-button {
    padding: 10px 25px;
    background: #fff;
    color: var(--breya-primary);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s;
}

.breya-footer-button:hover {
    background: #f0f0f0;
}

.breya-footer-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 0 10px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.breya-footer-close:hover {
    opacity: 1;
}

.breya-footer-message {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.breya-footer-message.success {
    background: rgba(255,255,255,0.2);
}

.breya-footer-message.error {
    background: rgba(255,0,0,0.2);
}

/* ==========================================================================
   Popup
   ========================================================================== */
.breya-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.breya-popup {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.breya-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: color 0.3s;
}

.breya-popup-close:hover {
    color: #333;
}

.breya-popup-content h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: var(--breya-text);
    text-align: center;
}

.breya-popup-content p {
    margin: 0 0 25px 0;
    color: #666;
    text-align: center;
    font-size: 16px;
}

.breya-popup-field {
    margin-bottom: 15px;
}

.breya-popup-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--breya-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.breya-popup-input:focus {
    outline: none;
    border-color: var(--breya-primary);
}

.breya-popup-button {
    width: 100%;
    padding: 14px 20px;
    background: var(--breya-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.breya-popup-button:hover {
    background: #135e96;
}

.breya-popup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.breya-popup-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.breya-popup-message.success {
    background: #d4edda;
    color: #155724;
}

.breya-popup-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   WooCommerce Checkout
   ========================================================================== */
.breya-subscribe-checkout {
    margin: 20px 0;
    padding: 15px;
    background: var(--breya-bg);
    border-radius: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .breya-footer-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .breya-footer-text {
        text-align: center;
    }
    
    .breya-footer-form {
        flex-direction: column;
    }
    
    .breya-footer-input {
        min-width: 100%;
    }
    
    .breya-footer-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    .breya-popup {
        padding: 30px 20px;
    }
    
    .breya-form-inline-fields {
        flex-direction: column;
    }
    
    .breya-form-inline-fields .breya-button {
        width: 100%;
    }
}

/* ==========================================================================
   RTL Support (Arabic)
   ========================================================================== */
[dir="rtl"] .breya-footer-close {
    right: auto;
    left: 10px;
}

[dir="rtl"] .breya-popup-close {
    right: auto;
    left: 15px;
}
