/**
 * VIA Styles - Yearbook Media
 * Styles pour le processus d'achat de campagnes publicitaires
 */

/* ==================== VARIABLES ==================== */
:root {
    --via-primary: #2563eb;
    --via-primary-hover: #1d4ed8;
    --via-success: #10b981;
    --via-danger: #ef4444;
    --via-warning: #f59e0b;
    --via-gray-50: #f9fafb;
    --via-gray-100: #f3f4f6;
    --via-gray-200: #e5e7eb;
    --via-gray-300: #d1d5db;
    --via-gray-600: #4b5563;
    --via-gray-800: #1f2937;
    --via-gray-900: #111827;
    --via-border-radius: 8px;
    --via-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --via-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --via-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ==================== RESET & BASE ==================== */
.via-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.via-container * {
    box-sizing: border-box;
}

/* ==================== NAVIGATION STEPS ==================== */
.via-steps-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0;
    list-style: none;
    position: relative;
}

.via-steps-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--via-gray-200);
    z-index: 0;
}

.via-step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.via-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--via-gray-200);
    color: var(--via-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.via-step-item.active .via-step-circle {
    background: var(--via-primary);
    color: white;
}

.via-step-item.completed .via-step-circle {
    background: var(--via-success);
    color: white;
}

.via-step-label {
    font-size: 14px;
    color: var(--via-gray-600);
    font-weight: 500;
}

.via-step-item.active .via-step-label {
    color: var(--via-primary);
    font-weight: 600;
}

/* ==================== STEPS CONTENT ==================== */
.via-steps-content {
    background: white;
    border-radius: var(--via-border-radius);
    box-shadow: var(--via-shadow-md);
    padding: 30px;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.via-step-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--via-gray-900);
    margin-bottom: 20px;
}

.via-step-description {
    color: var(--via-gray-600);
    margin-bottom: 30px;
}

/* ==================== FORMS ==================== */
.via-form-group {
    margin-bottom: 20px;
}

.via-label {
    display: block;
    font-weight: 600;
    color: var(--via-gray-800);
    margin-bottom: 8px;
    font-size: 14px;
}

.via-label.required::after {
    content: '*';
    color: var(--via-danger);
    margin-left: 4px;
}

.via-input,
.via-select,
.via-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--via-gray-300);
    border-radius: var(--via-border-radius);
    font-size: 14px;
    transition: all 0.2s;
}

.via-input:focus,
.via-select:focus,
.via-textarea:focus {
    outline: none;
    border-color: var(--via-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.via-input.error,
.via-select.error {
    border-color: var(--via-danger);
}

.via-textarea {
    resize: vertical;
    min-height: 100px;
}

.error-message {
    color: var(--via-danger);
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

.form-error-global {
    background: #fef2f2;
    border: 1px solid var(--via-danger);
    color: var(--via-danger);
    padding: 12px 16px;
    border-radius: var(--via-border-radius);
    margin-bottom: 20px;
}

/* ==================== FORM GRID ==================== */
.via-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ==================== BUTTONS ==================== */
.via-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--via-border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.via-btn-primary {
    background: var(--via-primary);
    color: white;
}

.via-btn-primary:hover {
    background: var(--via-primary-hover);
    box-shadow: var(--via-shadow-md);
}

.via-btn-secondary {
    background: var(--via-gray-200);
    color: var(--via-gray-800);
}

.via-btn-secondary:hover {
    background: var(--via-gray-300);
}

.via-btn-success {
    background: var(--via-success);
    color: white;
}

.via-btn-danger {
    background: var(--via-danger);
    color: white;
}

.via-btn:disabled,
.via-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.via-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== BUTTONS GROUP ==================== */
.via-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--via-gray-200);
}

/* ==================== CART / PANIER ==================== */
#via-cart {
    background: var(--via-gray-50);
    border-radius: var(--via-border-radius);
    padding: 20px;
    margin-top: 30px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--via-gray-900);
}

.btn-clear-cart {
    background: none;
    border: none;
    color: var(--via-danger);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--via-gray-600);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    background: white;
    border-radius: var(--via-border-radius);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    box-shadow: var(--via-shadow);
}

.cart-item-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--via-gray-900);
}

.cart-item-info {
    font-size: 13px;
    color: var(--via-gray-600);
    margin: 4px 0;
}

.cart-item-dates {
    font-size: 12px;
    color: var(--via-gray-600);
}

.cart-item-price {
    text-align: right;
}

.cart-item-price .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--via-primary);
}

.cart-item-actions {
    margin-left: 15px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--via-danger);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #fef2f2;
}

.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--via-gray-200);
}

.cart-total {
    background: white;
    padding: 15px;
    border-radius: var(--via-border-radius);
    margin-bottom: 15px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.cart-total-final {
    font-size: 18px;
    font-weight: 700;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--via-gray-200);
    color: var(--via-gray-900);
}

.cart-amount {
    font-weight: 600;
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: var(--via-success);
    color: white;
    border: none;
    border-radius: var(--via-border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-checkout:hover {
    background: #059669;
    box-shadow: var(--via-shadow-md);
}

/* ==================== CART BADGE ==================== */
#via-cart-count {
    background: var(--via-danger);
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    display: none;
    margin-left: 8px;
}

.via-cart-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.via-cart-item:hover {
    background: #e9ecef !important;
}

.via-cart-item-actions {
    position: relative;
    z-index: 10;
}

/* ==================== TARIF PREVIEW ==================== */
#tarif-preview {
    background: var(--via-gray-50);
    border-radius: var(--via-border-radius);
    padding: 20px;
    margin-top: 20px;
}

.tarif-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tarif-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--via-gray-800);
}

.tarif-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--via-primary);
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: var(--via-border-radius);
    box-shadow: var(--via-shadow-lg);
    z-index: 9999;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--via-success);
}

.notification-error {
    border-left: 4px solid var(--via-danger);
}

.notification-info {
    border-left: 4px solid var(--via-primary);
}

.notification-warning {
    border-left: 4px solid var(--via-warning);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .via-steps-nav {
        flex-wrap: wrap;
    }
    
    .via-step-item {
        flex-basis: 50%;
        margin-bottom: 20px;
    }
    
    .via-form-grid {
        grid-template-columns: 1fr;
    }
    
    .via-steps-content {
        padding: 20px;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-actions {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .via-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .via-btn {
        width: 100%;
    }
}

/* ==================== UTILITIES ==================== */
.via-text-center {
    text-align: center;
}

.via-mt-20 {
    margin-top: 20px;
}

.via-mb-20 {
    margin-bottom: 20px;
}

.via-hidden {
    display: none !important;
}
