/* ========================================
   CALCULATEUR DE VALEUR D'OR
   ======================================== */

/* ========================================
   BASE - Conteneur principal et bordures
   ======================================== */

.max-gold-calculator {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 36px;
    font-family: "Noto Serif", serif;
    border-radius: 21px !important;
    border: none !important;
    background-image: linear-gradient(-180deg, rgb(158, 137, 116) 0%, rgb(67, 49, 35) 100%) !important;
    background-blend-mode: overlay !important;
    background-repeat: repeat !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35), inset 0px 15px 120px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
}

/* Bordure dorée en dégradé avec effet 3D */
.max-gold-calculator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 21px;
    border: 5px solid transparent;
    background: linear-gradient(135deg,
        #f7e7b7 0%,
        #f0d592 18%,
        #d9b76a 32%,
        #b99149 46%,
        #e6c16a 60%,
        #f2de9a 76%,
        #c39a4b 88%,
        #8d6a2a 100%
    ) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

.max-gold-calculator::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 20px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -2px 4px rgba(0,0,0,0.35);
    pointer-events: none;
    z-index: 2;
}

.max-calculator-controls {
    position: relative;
    z-index: 11;
}

.max-gold-calculator-error {
    padding: 2rem;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    color: #ff6b6b;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

/* ========================================
   HEADER - En-tête du calculateur
   ======================================== */

.max-calculator-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 11;
}

.max-calculator-title {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fffdfd;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.max-calculator-subtitle {
    color: #ffffff;
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

/* ========================================
   CARATS - Boutons de sélection des carats
   ======================================== */

.max-calculator-carats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.max-carat-btn {
    flex: 0 0 auto;
    width: 140px;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg,
        #f7e7b7 0%,
        #f0d592 18%,
        #d9b76a 32%,
        #b99149 46%,
        #e6c16a 60%,
        #f2de9a 76%,
        #c39a4b 88%,
        #8d6a2a 100%
    );
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #1a1a1a;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(185, 145, 73, 0.4);
    z-index: 1;
}

/* Bordure brillante pour effet 3D */
.max-carat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    pointer-events: none;
    z-index: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Reflet lumineux animé */
.max-carat-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.4) 35%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.4) 65%,
        rgba(255, 255, 255, 0.2) 80%,
        transparent 100%
    );
    animation: gradientMove 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.max-carat-btn:hover::after {
    opacity: 0.6;
}

.max-carat-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(185, 145, 73, 0.6);
    background: linear-gradient(135deg,
        #f2de9a 0%,
        #f7e7b7 18%,
        #e6c16a 32%,
        #d9b76a 46%,
        #f0d592 60%,
        #f7e7b7 76%,
        #e6c16a 88%,
        #b99149 100%
    );
}

.max-carat-btn.active {
    background: linear-gradient(135deg,
        #f7e7b7 0%,
        #f2de9a 20%,
        #f0d592 40%,
        #f7e7b7 60%,
        #f2de9a 80%,
        #f0d592 100%
    );
    box-shadow: 0 10px 30px rgba(242, 222, 154, 0.8);
    transform: scale(1.15) !important;
    z-index: 10;
}

.max-carat-btn.active::after {
    opacity: 0.5;
}

.max-carat-gold {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a3c1f;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

.max-carat-label {
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.5),
        -1px -1px 1px rgba(0, 0, 0, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.max-carat-purity {
    font-size: 0.85rem;
    color: #4a3c1f;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.max-carat-price {
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 600;
    margin-top: 0.25rem;
    position: relative;
    z-index: 2;
}

/* ========================================
   WEIGHT - Curseur de poids / Slider
   ======================================== */

.max-calculator-weight {
    margin-bottom: 3rem;
    position: relative;
    z-index: 11;
}

.max-weight-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #fff;
}

.max-weight-icon {
    font-size: 1.5rem;
}

.max-weight-value {
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    display: inline-block;
    text-align: center;
}

.max-weight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.max-weight-input {
    width: 80px;
    padding: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: inherit;
    color: #ffd700;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-bottom: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 0;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    -moz-appearance: textfield;
}

.max-weight-input::-webkit-outer-spin-button,
.max-weight-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.max-weight-input:focus {
    border-bottom-color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
}

.max-weight-unit {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffd700;
}

.max-slider-wrapper {
    position: relative;
    padding: 0 1rem;
}

.max-weight-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.max-weight-slider:hover {
    background: rgba(255, 215, 0, 0.2);
}

/* Style du curseur pour Webkit (Chrome, Safari, Edge) */
.max-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.6);
    transition: all 0.3s ease;
    border: 2px solid #fff;
}

.max-weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.8);
}

/* Style du curseur pour Firefox */
.max-weight-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.6);
    transition: all 0.3s ease;
}

.max-weight-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.8);
}

/* Labels min/max */
.max-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #aaa;
}

/* ========================================
   RESULT - Zone d'affichage du résultat
   ======================================== */

.max-calculator-result {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    position: relative;
    z-index: 11;
    overflow: hidden;
}

.max-calculator-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

.max-result-label {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.max-result-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 60px;
    padding: 1rem 2rem;
    background: linear-gradient(135deg,
        #f7e7b7 0%,
        #f0d592 18%,
        #d9b76a 32%,
        #b99149 46%,
        #e6c16a 60%,
        #f2de9a 76%,
        #c39a4b 88%,
        #8d6a2a 100%
    );
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(185, 145, 73, 0.5);
}

.max-price-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
    transition: all 0.3s ease;
}

.max-price-currency {
    font-size: 2rem;
    color: #1a1a1a;
    font-weight: 600;
}

.max-result-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.max-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

.max-detail-label {
    opacity: 0.7;
}

.max-detail-value {
    color: #ffd700;
    font-weight: 600;
}

/* Bouton CTA Contact */
.max-calculator-cta {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg,
        #f7e7b7 0%,
        #f0d592 18%,
        #d9b76a 32%,
        #b99149 46%,
        #e6c16a 60%,
        #f2de9a 76%,
        #c39a4b 88%,
        #8d6a2a 100%
    );
    border-radius: 50px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(185, 145, 73, 0.5);
    transition: all 0.3s ease;
}

.max-calculator-cta.visible {
    display: inline-flex;
}

.max-calculator-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(185, 145, 73, 0.6);
    color: #1a1a1a;
}

.max-cta-icon {
    font-size: 1.5rem;
}

.max-cta-text strong {
    color: #1a1a1a;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes gradientMove {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.max-price-value.updating {
    animation: priceFlash 0.5s ease;
}

@keyframes priceFlash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.max-price-value.updated {
    animation: priceUpdate 0.6s ease-out;
}

@keyframes priceUpdate {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
}

/* ========================================
   THEMES
   ======================================== */

.max-calculator-theme-dark {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
}

.max-calculator-theme-light {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.max-calculator-theme-light .max-calculator-title,
.max-calculator-theme-light .max-carat-label,
.max-calculator-theme-light .max-price-value {
    color: #d4af37;
}

.max-calculator-theme-light .max-calculator-subtitle,
.max-calculator-theme-light .max-result-label {
    color: #666;
}

.max-calculator-theme-light .max-carat-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
    color: #333;
}

.max-calculator-theme-light .max-weight-label,
.max-calculator-theme-light .max-detail-item {
    color: #333;
}

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

@media (max-width: 768px) {
    .max-gold-calculator {
        padding: 20px 16px;
        margin: 1rem;
        border-radius: 21px !important;
    }
    
    .max-calculator-header {
        margin-bottom: 1.5rem;
    }
    
    .max-calculator-title {
        font-size: 1.8rem;
    }
    
    .max-calculator-subtitle {
        font-size: 1rem;
    }
    
    .max-calculator-carats {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .max-carat-btn {
        width: calc(33.33% - 0.5rem);
        min-width: 90px;
        max-width: 110px;
        padding: 0.75rem 0.5rem;
        gap: 0.25rem;
    }
    
    .max-carat-btn.active {
        transform: scale(1.05) !important;
    }
    
    .max-carat-gold {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }
    
    .max-carat-label {
        font-size: 1.5rem;
    }
    
    .max-carat-purity {
        font-size: 0.7rem;
    }
    
    .max-carat-price {
        font-size: 0.7rem;
    }
    
    .max-calculator-weight {
        margin-bottom: 2rem;
    }
    
    .max-weight-label {
        font-size: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .max-weight-input {
        width: 70px;
        font-size: 1.2rem;
        padding: 0.4rem;
    }
    
    .max-weight-unit {
        font-size: 1rem;
    }
    
    .max-calculator-result {
        padding: 1.5rem 1rem;
    }
    
    .max-result-price {
        padding: 0.75rem 1.5rem;
    }
    
    .max-price-value {
        font-size: 2rem;
    }
    
    .max-price-currency {
        font-size: 1.3rem;
    }
    
    .max-calculator-cta {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .max-cta-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .max-gold-calculator {
        padding: 16px 12px;
        margin: 0.5rem;
    }
    
    .max-calculator-title {
        font-size: 1.6rem;
    }
    
    .max-calculator-subtitle {
        font-size: 0.95rem;
    }
    
    .max-calculator-carats {
        gap: 0.4rem;
    }
    
    .max-carat-btn {
        width: calc(33.33% - 0.4rem);
        min-width: 80px;
        max-width: 100px;
        padding: 0.6rem 0.4rem;
        border-radius: 8px;
    }
    
    .max-carat-gold {
        font-size: 0.6rem;
    }
    
    .max-carat-label {
        font-size: 1.3rem;
    }
    
    .max-carat-purity {
        font-size: 0.65rem;
    }
    
    .max-carat-price {
        font-size: 0.65rem;
    }
    
    .max-weight-input {
        width: 65px;
        font-size: 1.1rem;
    }
    
    .max-result-price {
        padding: 0.6rem 1rem;
    }
    
    .max-price-value {
        font-size: 1.8rem;
    }
    
    .max-price-currency {
        font-size: 1.1rem;
    }
    
    .max-calculator-cta {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 30px;
    }
    
    .max-cta-text {
        text-align: center;
        line-height: 1.3;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .max-calculator-result::before {
        animation: none;
    }
    
    .max-price-value.updated {
        animation: none;
    }
    
    .max-carat-btn {
        transition: none;
    }
    
    .max-carat-btn::after {
        animation: none;
    }
}
