/* 
   m-ttech Modern UI Enhancements (v1.0)
   This file overrides legacy styles for a more premium experience.
*/

/* 1. Global Structure Fixes */
html {
    overflow-x: clip !important;
}
body {
    overflow-x: clip !important;
}

/* 2. Unified Glassmorphism (Dark Mode) */
body.dark-mode .service-card,
body.dark-mode .product-card,
body.dark-mode .blog-card,
body.dark-mode .feature-card,
body.dark-mode .affiliate-card,
body.dark-mode .estimator-card,
body.dark-mode .modal-content {
    background: rgba(30, 41, 59, 0.45) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
}

/* 3. Sticky Modal Close Button */
.close-modal {
    position: sticky !important;
    top: 5px !important;
    left: 5px !important;
    z-index: 999 !important;
    background: var(--bg-white) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body.dark-mode .close-modal {
    background: #1e293b !important;
    color: white !important;
    border-color: rgba(255,255,255,0.1) !important;
}

/* 4. Sleek Device Mockups */
.phone-frame {
    border-radius: 36px !important;
    border: 7px solid #1e293b !important;
    background: #000 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}
.laptop-frame {
    border-radius: 14px !important;
    border: 10px solid #1e293b !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* 5. Mobile Adjustments */
@media (max-width: 480px) {
    .section-title h2 {
        font-size: 1.5rem !important;
    }
    .hero h1 {
        font-size: 1.7rem !important;
    }
    .service-card, .blog-card {
        padding: 20px !important;
    }
}

/* 6. Fix for missing Search/Cat in style.css */
.search-bar input {
    width: 100% !important;
    padding: 12px 45px 12px 20px !important;
    border-radius: 50px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}
.search-bar i {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}
.category-filters {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}
.cat-btn {
    padding: 8px 18px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
}

/* Portfolio Cards Layout Fix */
.product-info {
    padding: 25px !important;
    text-align: right !important;
}
.product-info h3 {
    margin-bottom: 10px !important;
    font-size: 1.3rem !important;
}
.product-info p {
    margin-bottom: 20px !important;
    min-height: 50px;
}
.project-actions {
    display: flex !important;
    gap: 12px !important;
    margin-top: auto !important;
}
.btn-case-study {
    flex: 4 !important;
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: 0.3s !important;
}
.btn-case-study:hover {
    background: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-project-link {
    flex: 1 !important;
    background: #f1f5f9 !important;
    color: var(--primary) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 12px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: 0.3s !important;
}
.btn-project-link:hover {
    background: #e2e8f0 !important;
    color: var(--text-dark) !important;
}

/* --- PREMIUM CHAT RE-DESIGN --- */
#chatWidget {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
    bottom: 90px !important;
    width: 360px !important;
    overflow: hidden !important;
}

body.dark-mode #chatWidget {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary), #2563eb) !important;
    padding: 18px 20px !important;
    border-bottom: none !important;
}

.chat-body {
    padding: 20px !important;
    background: transparent !important;
}

/* Chat Bubbles Style */
.chat-msg {
    max-width: 85% !important;
    padding: 12px 16px !important;
    border-radius: 20px !important;
    font-size: 0.92rem !important;
    margin-bottom: 12px !important;
    line-height: 1.5 !important;
}

.chat-msg.bot {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom-right-radius: 5px !important;
}

body.dark-mode .chat-msg.bot {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.chat-msg.user {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border-bottom-left-radius: 5px !important;
    margin-right: auto !important;
}

/* Professional Input Area */
.chat-footer {
    padding: 15px !important;
    background: transparent !important;
    border-top: 1px solid rgba(0,0,0,0.05) !important;
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}

#chatInput {
    background: rgba(255,255,255,0.9) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 25px !important;
    padding: 10px 20px !important;
    flex: 1 !important;
    transition: 0.3s !important;
}

body.dark-mode #chatInput {
    background: rgba(30, 41, 59, 1) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: white !important;
}

#chatInput:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.send-btn {
    background: var(--primary) !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: 0.3s !important;
}

.send-btn:hover {
    transform: scale(1.1) rotate(-10deg) !important;
}

/* Ensure Modals are visible */
.modal.active {
    display: flex !important;
    z-index: 99999 !important;
}
body.dark-mode .modal-content {
    background: #0f172a !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: white !important;
}
.case-result-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border-right: 5px solid var(--primary);
    color: #1e293b;
    margin-top: 20px;
}
body.dark-mode .case-result-box {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #60a5fa !important;
    color: #e2e8f0 !important;
}
body.dark-mode .case-result-box strong {
    color: #60a5fa !important;
}

.case-sub-card {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 12px;
    color: #1e293b;
}
body.dark-mode .case-sub-card {
    background: #1e293b !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #cbd5e1 !important;
}
body.dark-mode .case-sub-card h5 {
    color: #60a5fa !important;
}
