/* Settings Redesign & Profile Card Styles */
:root {
    --settings-bg: #ffffff;
    --settings-sidebar: #f8f9fa;
    --settings-border: rgba(0,0,0,0.08);
    --settings-accent: #000;
}

.settings-section {
    position: fixed;
    top: 70px;
    left: 85px; /* Adjust for side-nav on desktop */
    right: 0;
    bottom: 0;
    background: var(--settings-bg);
    z-index: 2000; /* High enough to be above backgrounds but below side-nav (3000) */
    overflow: hidden;
    display: none; /* Controlled by JS */
}

@media (max-width: 768px) {
    .settings-section {
        left: 0;
        top: 60px;
        bottom: 90px; /* Space for mobile bottom nav */
        z-index: 4000; /* Above everything on mobile except side-nav */
    }
}

.settings-container {
    display: flex !important;
    height: calc(100vh - 70px) !important; /* Force screen height on desktop */
    min-height: 500px !important; /* Fallback for collapse */
    width: 100%;
    background: #ffffff !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Left Menu */
.settings-menu {
    width: 320px;
    min-width: 320px; /* Force minimum width */
    height: 100% !important;
    min-height: 500px !important; /* Force visibility */
    border-right: 1.5px solid rgba(0,0,0,0.1);
    border-left: 1px solid rgba(255, 0, 0, 0.2); /* Diagnostic border - remove later */
    background: #f8f9fa !important; /* Force distinct color from content */
    display: flex !important;
    visibility: visible !important;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 5;
}

.settings-menu-header {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--settings-border);
}

.back-btn-settings {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--msg-text-muted);
}

.settings-menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.settings-opt-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 8px;
}

.settings-opt-item:hover {
    background: rgba(0,0,0,0.03);
}

.settings-opt-item.active {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--settings-border);
}

.opt-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.opt-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.opt-details p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--msg-text-muted);
}

/* Right Content */
.settings-content {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.settings-blank-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--msg-text-muted);
    text-align: center;
}

.animated-shapes {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.shape-1 {
    width: 100px; height: 100px; background: #ff7675; top: 20%; left: 20%;
}

.shape-2 {
    width: 120px; height: 120px; background: #74b9ff; bottom: 20%; right: 20%;
    animation-delay: -2s;
}

.shape-3 {
    width: 80px; height: 80px; background: #a29bfe; top: 50%; left: 50%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Profile Card Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999999; /* Highest priority */
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    background: #fff;
    width: 420px;
    max-width: 92%;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-modal {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(0,0,0,0.05);
    border: none; width: 35px; height: 35px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer; color: #666;
    z-index: 100; transition: 0.2s;
}

.close-modal:hover { background: rgba(0,0,0,0.1); color: #000; }

.profile-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 50px 20px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.profile-main-info img {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.profile-main-info h3 { margin: 0; font-size: 1.4rem; }
.profile-main-info p { margin: 5px 0 0; color: #666; font-family: monospace; }

.profile-card-body {
    padding: 25px;
}

.profile-info-group {
    margin-bottom: 20px;
}

.profile-info-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.profile-info-group p {
    margin: 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
}

/* Edit Controls */
.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bio-edit-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-section {
        left: 0;
        top: 0;
    }
    
    .settings-container {
        flex-direction: column;
    }
    
    .settings-menu {
        width: 100%;
        height: auto;
    }
    
    .settings-content {
        display: none !important;
        height: 100%;
    }
    
    .settings-section.tab-active .settings-menu {
        display: none !important;
    }
    
    .settings-section.tab-active .settings-content {
        display: flex !important;
        flex-direction: column;
    }

    #settings-dynamic-content {
        padding: 20px !important;
    }
}

/* Settings Mobile Header */
.settings-mobile-header {
    display: none; /* Desktop hidden */
}

@media (max-width: 768px) {
    .settings-mobile-header {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: #fff;
        border-bottom: 1px solid var(--settings-border);
        position: sticky;
        top: 0;
        z-index: 100;
        flex-shrink: 0;
    }

    .settings-mobile-header .back-btn-settings {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1rem;
        color: var(--accent, #000);
        background: none;
        border: none;
        font-weight: 600;
        padding: 5px;
        cursor: pointer;
    }

    .settings-mobile-header h3 {
        flex: 1;
        text-align: center;
        margin: 0;
        padding-right: 80px; /* Balance visually against the back button */
        font-size: 1.1rem;
        font-weight: 700;
    }
}

/* Profile Specific View Styles */
.profile-hero-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin: 40px;
    margin-bottom: 25px;
    border: 1px solid var(--settings-border);
}

.profile-hero-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-hero-top img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.profile-hero-meta h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-hero-meta p {
    margin: 5px 0 0;
    color: var(--msg-text-muted);
    font-size: 0.9rem;
}

.settings-group-box {
    margin: 0 40px 15px;
    padding: 20px;
    border: 1px solid var(--settings-border);
    border-radius: 12px;
}

.settings-group-box label {
    display: block;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 10px;
}

.val-text {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.edit-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: 0.2s;
}

.edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- PROFESSIONAL ARCHITECT DESIGN SYSTEM (V2) --- */
.theme-studio-premium {
    position: relative;
    padding: 0;
    background: #fdfdfd;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    color: #111;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
}

.mesh-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #f0f2f5 0%, #e9ecef 100%);
}

.theme-content-wrapper {
    position: relative;
    z-index: 1;
    padding: 40px;
    padding-bottom: 150px; /* Safe space for fixed mobile nav */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.theme-card-glass {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.studio-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.studio-subtitle {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 40px;
    font-weight: 500;
}

/* Technical Labels */
.tech-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #bbb;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

/* Virtual Smartphone Mockup */
.device-container {
    position: sticky;
    top: 20px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    padding: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    border: 1px solid #ddd;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.03);
}

.device-mockup {
    width: 320px;
    height: 640px;
    max-width: 100%; /* Responsive scaling */
    background: #000;
    border-radius: 40px;
    padding: 12px; /* Bezel */
    box-shadow: 0 40px 100px rgba(0,0,0,0.15), 0 0 0 4px #222;
    position: relative;
    overflow: hidden;
    transform-origin: top center;
}

.mockup-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mockup-status-bar {
    height: 35px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #000;
}

.mockup-chat {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chat-bg-image, #f5f5f5);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Value Labels */
.val-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* High-Precision Inputs */
.theme-select-pro {
    width: 100%;
    padding: 12px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    outline: none;
    cursor: pointer;
    transition: border 0.2s;
}

.theme-select-pro:focus {
    border-color: #000;
}

.theme-input-range {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin: 20px 0;
}

.theme-input-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 0; /* Square thumb for industrial look */
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Preset Matrix */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.preset-chip {
    padding: 12px;
    border-radius: 2px;
    cursor: pointer;
    text-align: center;
    font-weight: 700;
    font-size: 0.7rem;
    transition: 0.15s;
    border: 1px solid #eee;
    background: #fdfdfd;
    color: #444;
}

.preset-chip:hover {
    background: #f0f0f0;
}

.preset-chip.active {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* Geometric Matrix */
.shape-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
}

.shape-preview-pro {
    aspect-ratio: 1;
    cursor: pointer;
    transition: 0.2s;
}

.shape-preview-pro:hover {
    transform: scale(1.1);
    opacity: 1 !important;
}

/* Live /* Bento Framework */
/* Bento Framework */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Response: Stack bento on smaller screens for readability */
@media (max-width: 1100px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    /* Center mockup when stacked */
    .device-container {
        position: relative;
        top: 0;
        margin-bottom: 40px;
    }
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.matrix-chip {
    padding: 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
    text-align: center;
    transition: 0.15s;
}

.matrix-chip:hover {
    background: #f9f9f9;
}

.matrix-chip.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Precision Elements */
.theme-select-pro {
    width: 100%;
    padding: 12px;
    border-radius: 2px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-architect {
    background: #000;
    color: #fff;
    padding: 18px 45px;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-architect:hover {
    background: #111;
    transform: scale(1.02);
}

.theme-section h3 {
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 25px;
}
