/**
 * AI-Vision Virtual Try-On - Master Premium Stylesheet
 * Developed for: OpticoBD
 * Branding Color: #003A6D
 * Border Radius: 5px (Hardcoded)
 * Version: 3.7.0 (Expanded)
 */

/* ==========================================
   ১. পপআপ ওভারলে (Backdrop)
   ========================================== */
.avto-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Safari Support */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999999;
    padding: 15px;
    box-sizing: border-box;
}

/* ==========================================
   ২. মেইন গ্লাস মরফিজম কন্টেনার
   ========================================== */
.avto-modal-content {
    background-color: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 15px 50px rgba(0, 58, 109, 0.15) !important;
    padding: 25px;
    border-radius: 5px !important; /* Requirement: Exactly 5px */
    max-width: 480px; 
    width: 100%;
    max-height: 96vh; /* ডেস্কটপ স্ক্রল সমস্যা সমাধান */
    position: relative;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* ভেতরের টেক্সট যাতে বাইরে না যায় */
}

/* ডেস্কটপ ভিউ অপ্টিমাইজেশন */
@media (min-width: 1024px) {
    .avto-modal-content {
        max-width: 460px !important;
        padding: 30px;
        max-height: 92vh;
    }
}

/* ==========================================
   ৩. ক্লোজ বাটন (Visible "✕ Close")
   ========================================== */
.avto-close {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 11px !important;
    cursor: pointer;
    color: #333 !important;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.85);
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-transform: uppercase;
    line-height: 1.2;
    transition: 0.2s ease-in-out;
}

.avto-close:hover {
    background: #ff4757;
    color: #ffffff !important;
    border-color: #ff4757;
}

/* ==========================================
   ৪. ক্যানভাস এরিয়া এবং ফেস ফিটিং
   ========================================== */
.avto-canvas-container {
    position: relative;
    margin: 10px 0;
    background: #fdfdfd;
    border-radius: 5px !important;
    aspect-ratio: 4/5;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(0, 58, 109, 0.1);
    cursor: pointer;
    width: 100%;
}

#avto-output-canvas {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* ফেস কেটে যাওয়া রোধ করে */
    border-radius: 5px !important;
    display: none; /* JS দিয়ে লোড হবে */
}

/* ==========================================
   ৫. প্লেসহোল্ডার (লেখা যাতে পাশে না যায়)
   ========================================== */
#avto-placeholder {
    position: absolute; /* ক্যানভাসের ওপরে ফিক্সড */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    text-align: center;
    background: #fdfdfd;
    z-index: 5;
    box-sizing: border-box;
}

.avto-placeholder-icon {
    font-size: 45px;
    margin-bottom: 15px;
    opacity: 0.5;
    color: #003A6D;
}

#avto-placeholder p {
    color: #003A6D !important;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 600;
    margin: 0;
    max-width: 280px;
}

/* ==========================================
   ৬. প্রিমিয়াম লোডিং স্পিনার (#003A6D)
   ========================================== */
#avto-loading-spinner {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.88);
    z-index: 500;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.avto-loader {
    width: 45px;
    height: 45px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #003A6D;
    border-radius: 50%;
    animation: avto-spin-loader 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.avto-loading-text {
    margin-top: 15px;
    color: #003A6D;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

@keyframes avto-spin-loader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   ৭. এআই স্ট্যাটাস ব্যাজ (Face Shape | Age)
   ========================================== */
#avto-shape-badge {
    background: #003A6D !important;
    color: #ffffff !important;
    font-size: 10px;
    padding: 6px 16px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

/* ==========================================
   ৮. কন্ট্রোল বাটন (৫০% উইডথ অপ্টিমাইজেশন)
   ========================================== */
.avto-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.avto-btn {
    flex: 1 1 calc(50% - 10px); /* মোবাইলে পাশাপাশি ২ কলাম */
    padding: 14px 5px;
    border: none;
    border-radius: 5px !important;
    font-weight: 700;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.avto-btn.primary { background: #003A6D !important; color: #fff !important; }
.avto-btn.secondary { background: #fff !important; color: #003A6D !important; border: 1px solid #003A6D !important; }
.avto-btn.danger { background: #ff4757 !important; color: #ffffff !important; }
.avto-btn.success { background: #2ed573 !important; color: #ffffff !important; }

.avto-btn:active { transform: scale(0.96); }

/* মিরর বাটন স্টাইল */
#avto-toggle-mirror {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 50;
    background: rgba(0, 58, 109, 0.85) !important;
    color: #fff !important;
    padding: 6px 14px;
    font-size: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
}

/* ==========================================
   ৯. মোবাইল স্পেসিফিক টুইকস
   ========================================== */
@media (max-width: 480px) {
    .avto-modal-content {
        padding: 15px;
        width: 98%;
        max-height: 98vh;
    }
    .avto-btn {
        font-size: 9px;
        padding: 12px 2px;
    }
    .avto-close {
        font-size: 10px;
        padding: 4px 10px;
    }
    #avto-placeholder p {
        font-size: 13px;
        max-width: 220px;
    }
}

/* এরর ওভারলে স্টাইল */
#avto-error-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 600;
    padding: 30px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ff4757;
    border-radius: 5px;
}