/* ==========================================
   Dynasty 8 - Styles pour Générateur de Devis
   Thème inspiré du site principal Dynasty 8
   ========================================== */

:root {
    --primary-green: #18713C;
    --primary-dark: #09182e;
    --primary-darker: #071224;
    --secondary-teal: rgba(32, 134, 107, 0.75);
    --accent-warning: #ffc107;
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --text-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --overlay-dark: rgba(9, 24, 46, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-white);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   Header (Style Dynasty 8)
   ========================================== */

.header {
    background: var(--primary-green);
    opacity: 0.95;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--text-white);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.header nav a {
    color: var(--text-white);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--text-white);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.header nav a:hover {
    background: var(--text-white);
    color: var(--primary-green);
}

/* ==========================================
   Dev Banner
   ========================================== */

.dev-banner {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    padding: 0.75rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid #e85d2a;
}

.dev-banner p {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.warning-icon {
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

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

/* ==========================================
   Main Content
   ========================================== */

.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
    background: var(--bg-light);
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #22c55e, var(--primary-green));
    color: var(--text-white);
    border-radius: 0;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* ==========================================
   Content Wrapper avec Sidebar
   ========================================== */

.content-wrapper {
    display: grid;
    grid-template-columns: 450px minmax(600px, 900px);
    gap: 2rem;
    align-items: start;
    justify-content: center;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .zone-map-sidebar {
        max-width: 600px;
        margin: 0 auto 2rem;
    }
}

/* ==========================================
   Zone Map Sidebar
   ========================================== */

.zone-map-sidebar {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    align-self: start;
}

.zone-map-sidebar h4 {
    color: var(--primary-green);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.zone-map-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.zone-map-image:hover {
    transform: scale(1.02);
}

/* Modal pour zoomer la carte */
.map-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.map-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
}

.map-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.map-modal-close:hover {
    color: #bbb;
}

/* ==========================================
   Barre de progression
   ========================================== */

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.progress-step.completed .progress-step-circle::after {
    content: '✓';
}

.progress-step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

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

/* ==========================================
   Prix flottant sticky
   ========================================== */

.floating-price {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-green);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.floating-price.show {
    transform: translateY(0);
}

.floating-price-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.floating-price-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.floating-price-value {
    font-size: 2rem;
    font-weight: 700;
}

.floating-price-btn {
    background: white;
    color: var(--primary-green);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.floating-price-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Animations fluides
   ========================================== */

.form-group, .form-row {
    animation: fadeIn 0.3s ease;
}

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

select, input[type="checkbox"] {
    transition: all 0.2s ease;
}

/* ==========================================
   Tooltips
   ========================================== */

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
    cursor: help;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background: var(--primary-darker);
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-darker) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ==========================================
   Form Section
   ========================================== */

.form-section {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}


.form-section h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-green);
    text-transform: uppercase;
}

.form-section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.form-group label {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(24, 113, 60, 0.25);
}

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

/* ==========================================
   Zone Map
   ========================================== */

.zone-map {
    display: none; /* Ancienne version cachée */
}

/* ==========================================
   Preview Section
   ========================================== */

.preview-section {
    grid-column: 1 / -1;
    margin-top: 2rem;
}

/* ==========================================
   Options
   ========================================== */

#optionsContainer {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.option-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.option-item input {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* ==========================================
   Buttons
   ========================================== */

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    min-width: 200px;
    flex: 0 0 auto;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--text-white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--text-secondary);
    color: var(--text-white);
    border: 1px solid var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
}

/* ==========================================
   Preview Section
   ========================================== */

.preview-section {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-green);
}

.preview-header h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.devis-preview {
    background: white;
    color: #333;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.devis-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--primary-green);
}

.devis-logo {
    flex: 1;
}

.devis-logo h1 {
    color: var(--primary-green);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.devis-logo p {
    color: #666;
    font-size: 0.9rem;
}

.devis-info {
    text-align: right;
    flex: 1;
}

.devis-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.devis-date {
    color: #666;
    font-size: 0.9rem;
}

.devis-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.partie {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.partie h4 {
    color: var(--primary-green);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.partie p {
    color: #333;
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

.property-details {
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.property-details h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.property-item {
    display: flex;
    flex-direction: column;
}

.property-label {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.property-value {
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}

.pricing-table {
    margin: 2rem 0;
}

.pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th {
    background: var(--primary-green);
    color: var(--text-white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.pricing-table td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.pricing-table tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.pricing-total {
    background: #f8f9fa;
    font-weight: 700;
    font-size: 1.1rem;
}

.pricing-total td {
    color: var(--primary-dark);
    padding: 1.5rem 1rem;
}

.devis-notes {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #e8f5e9;
    border-left: 4px solid var(--primary-green);
    border-radius: 4px;
}

.devis-notes h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.devis-notes p {
    color: #333;
    line-height: 1.6;
}

.devis-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
    background: var(--primary-green);
    border-top: none;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    color: var(--text-white);
    margin: 0.3rem 0;
    opacity: 0.9;
}

/* ==========================================
   Responsive
   ========================================== */

@media (min-width: 1024px) {
    .content-wrapper {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .hero-section h2 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .form-section,
    .preview-section {
        padding: 1.5rem;
    }
    
    .zone-map-sidebar {
        max-width: 100%;
        padding: 1rem;
    }
    
    .zone-map-sidebar h4 {
        font-size: 1rem;
    }

    .devis-preview {
        padding: 1.5rem;
    }

    .devis-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .devis-info {
        text-align: left;
    }

    .devis-parties {
        grid-template-columns: 1fr;
    }

    .option-item {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: auto;
    }
}

@media print {
    body {
        background: white;
    }

    .header,
    .dev-banner,
    .footer,
    .form-section,
    .zone-map-sidebar,
    .progress-bar,
    .floating-price,
    .map-modal,
    .preview-header button {
        display: none !important;
    }

    .content-wrapper {
        display: block !important;
        max-width: 100%;
    }

    .preview-section {
        border: none;
        box-shadow: none;
        padding: 0;
        display: block !important;
    }

    .devis-preview {
        box-shadow: none;
        page-break-inside: avoid;
    }

    /* Ajout du QR code et info de contact pour l'impression */
    .preview-section::after {
        content: "";
        display: block;
        width: 150px;
        height: 150px;
        margin: 2rem auto;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect width="200" height="200" fill="white"/><text x="100" y="100" text-anchor="middle" font-size="16" fill="black">QR Code</text><text x="100" y="120" text-anchor="middle" font-size="12" fill="gray">dynasty.storylife.fr</text></svg>');
        background-size: contain;
        border: 2px solid var(--primary-green);
        border-radius: 8px;
    }

    .devis-preview::after {
        content: "📱 Plus d\'informations sur dynasty.storylife.fr | 📞 Contact: Dynasty 8 Real Estate";
        display: block;
        text-align: center;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 2px solid var(--primary-green);
        font-size: 0.9rem;
        color: var(--text-secondary);
    }

}
