/**
 * PFT34 Machine Modal Styling
 * Premium Minimalist / Glassmorphism
 */

/* Modal Backdrop */
.pft-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 20px;
}

.pft-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.pft-modal-container {
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    min-height: 0; /* Important pour le scroll flexbox */
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.pft-modal-overlay.is-active .pft-modal-container {
    transform: translateY(0) scale(1);
}

/* Header */
.pft-modal-header {
    padding: 30px 40px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    flex-shrink: 0;
}

.pft-modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.pft-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.pft-modal-close {
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pft-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Body Content */
.pft-modal-body {
    flex: 1 1 auto;
    overflow-y: auto !important;
    padding: 40px;
    min-height: 0;
    max-height: calc(90vh - 110px); /* Sécurité pour le scroll */
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.pft-modal-body::-webkit-scrollbar {
    width: 6px;
}

.pft-modal-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.pft-modal-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 50px;
}

.pft-modal-visual {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pft-modal-image {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
}

.pft-modal-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Typography */
.pft-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.pft-content-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
}

.pft-content-text p {
    margin-bottom: 1.5rem;
}

/* Sidebar */
.pft-modal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.pft-modal-section {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
}

.pft-modal-logiciels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pft-modal-soft-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.pft-modal-soft-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.pft-modal-soft-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
}

/* CTA */
.pft-modal-contact-cta {
    text-align: center;
}

.pft-modal-contact-cta p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 15px;
}

.pft-button-outline {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid #0f172a;
    border-radius: 50px;
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pft-button-outline:hover {
    background: #0f172a;
    color: #fff;
}

/* Loading State */
.pft-modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    color: #64748b;
}

.pft-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,0.05);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: pft-spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

/* Responsive */
@media (max-width: 900px) {
    .pft-modal-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .pft-modal-container {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .pft-modal-header {
        padding: 20px;
    }
    
    .pft-modal-body {
        padding: 20px;
    }
}

/* ============================================================
   PFT34 – Centered Project Modal Layout (Premium & Elegant)
   ============================================================ */

/* Outer structure centering & full width */
.pft-modal-content-inner.pft-project-modal-layout {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Header alignment & centering */
.pft-project-modal-layout .pft-modal-header {
    text-align: center !important;
    flex-direction: column !important;
    gap: 15px !important;
    position: relative !important;
    padding: 35px 40px 25px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-bottom: 1px solid #f1f5f9 !important;
    flex-shrink: 0 !important;
}

.pft-project-modal-layout .pft-modal-header .pft-modal-title-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
}

.pft-project-modal-layout .pft-modal-title {
    text-align: center !important;
    width: 100% !important;
    margin: 10px 0 0 0 !important;
}

.pft-project-modal-layout .pft-modal-close {
    position: absolute !important;
    top: 25px !important;
    right: 25px !important;
    margin: 0 !important;
}

/* Categories row pills */
.pft-project-modal-cats {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 15px !important;
    flex-wrap: wrap !important;
}

.pft-project-cat-pill {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 6px 16px !important;
    border-radius: 50px !important;
    border: 1px solid #e2e8f0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
}

/* Body container must take 100% width and display as flex to center contents */
.pft-project-modal-layout .pft-modal-body {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important; /* Horizontally center the project container */
    align-items: flex-start !important;
    padding: 40px !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
}

/* Stacked container */
.pft-project-modal-layout .pft-project-modal-container {
    width: 100% !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 35px !important;
    padding-bottom: 20px !important;
    align-items: stretch !important; /* Ensure children stretch to 100% width */
}

/* Rounded full-width image card */
.pft-project-modal-layout .pft-project-image {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 520px !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    margin: 0 auto !important;
}

.pft-project-modal-layout .pft-project-image img {
    width: 100% !important;
    height: 100% !important;
    max-height: 520px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Content block styling */
.pft-project-modal-layout .pft-project-description {
    text-align: left !important;
    font-size: 1.05rem !important;
    line-height: 1.8 !important;
    color: #334155 !important;
    width: 100% !important;
}

.pft-project-modal-layout .pft-project-description .pft-content-text {
    width: 100% !important;
}

/* Premium stacked Call to Action */
.pft-project-modal-layout .pft-project-modal-cta {
    text-align: center !important;
    background: #f8fafc !important;
    padding: 35px !important;
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    margin-top: 15px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.pft-project-modal-layout .pft-project-modal-cta p {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.pft-project-modal-layout .pft-project-modal-cta .pft-button-outline {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    padding: 14px 40px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-block !important;
}

.pft-project-modal-layout .pft-project-modal-cta .pft-button-outline:hover {
    background: #e11d48 !important;
    border-color: #e11d48 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(225, 29, 72, 0.3) !important;
}

@media (max-width: 768px) {
    .pft-project-modal-layout .pft-project-image {
        max-height: 320px !important;
    }
    .pft-project-modal-layout .pft-project-modal-cta {
        padding: 25px !important;
    }
}
