/* linkandbook_saas/static/css/saas-style.css */

/* ========================================= */
/* 1. THEME VARIABLES & CONFIGURATION        */
/* ========================================= */
:root {
    /* --- LIGHT MODE (DEFAULT) --- */
    --brand-primary: #0d6efd;
    --brand-secondary: #6c757d;
    
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-input: #ced4da;

    --nav-height: 70px;
    --shadow-soft: 0 -4px 20px rgba(0,0,0,0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- DARK MODE OVERRIDES --- */
/* Applied via class .theme-dark OR auto preference */
body.theme-dark,
@media (prefers-color-scheme: dark) {
    body.theme-auto {
        --bg-body: #0f172a;
        --bg-card: #1e293b;
        --bg-input: #334155;
        --bg-hover: #334155;
        
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        
        --border-color: #334155;
        --border-input: #475569;
        
        --shadow-soft: 0 -4px 20px rgba(0,0,0,0.3);
        --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    }
}

/* ========================================= */
/* 2. GLOBAL RESET & BASE STYLES             */
/* ========================================= */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    padding-bottom: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, p, span, div {
    /* Allow inheritance but ensure defaults use variable */
    color: inherit; 
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ========================================= */
/* 3. BOOTSTRAP COMPONENT OVERRIDES          */
/* ========================================= */

/* Cards & Containers */
.card, .list-group-item, .modal-content, .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.card-header, .card-footer, .modal-header, .modal-footer {
    border-color: var(--border-color);
    background-color: rgba(0,0,0,0.02); /* Translucent to work on both modes */
}
body.theme-dark .card-header, 
body.theme-dark .card-footer {
    background-color: rgba(255,255,255,0.05);
}

/* Forms & Inputs */
.form-control, .form-select, .input-group-text {
    background-color: var(--bg-input);
    border-color: var(--border-input);
    color: var(--text-main);
}
.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Buttons */
.btn-primary, .btn-danger, .btn-success {
    color: #ffffff !important; /* Always white text on solid primary buttons */
}
.btn-outline-secondary {
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-close {
    /* Filter ensures the 'X' icon is visible in dark mode */
}
body.theme-dark .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Text Utilities Fixes */
/* Ensures .text-dark turns white in dark mode */
body.theme-dark .text-dark,
body.theme-dark .text-body {
    color: var(--text-main) !important;
}
.text-muted {
    color: var(--text-muted) !important;
}

/* ========================================= */
/* 4. CUSTOM COMPONENTS                      */
/* ========================================= */

.register-card {
    border-radius: 1.5rem;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.btn-rounded { border-radius: 50px; }

.btn-google, .btn-lg-custom {
    height: 50px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    font-weight: 600;
}

/* ========================================= */
/* 5. APP BOTTOM NAVIGATION                  */
/* ========================================= */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0; right: 0; margin: 0 auto; /* Centering */
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 0 15px;
    z-index: 1050;
    box-shadow: var(--shadow-soft);
}

/* Desktop: Floating Dock Style */
@media (min-width: 768px) {
    .app-bottom-nav {
        max-width: 480px;
        border-radius: 20px 20px 0 0;
        border: 1px solid var(--border-color);
        border-bottom: none;
    }
}

/* Grid Layout */
.app-bottom-nav.five-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 70px 1fr 1fr;
    align-items: stretch;
    justify-items: stretch;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Nav Items */
.app-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 4px;
    width: 100%;
    padding-bottom: 12px;
    transition: all 0.2s ease;
}

.app-bottom-nav .nav-item i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.app-bottom-nav .nav-item.active {
    color: var(--brand-primary);
}
.app-bottom-nav .nav-item.active i {
    transform: translateY(-2px);
}
.app-bottom-nav .nav-item:active {
    transform: scale(0.95);
}

/* Center Button (Floating) */
.nav-item-center-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    top: -25px;
    z-index: 1051;
}

.nav-item-center {
    width: 64px;
    height: 64px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    /* The border matches body bg, creating a "cutout" effect that adapts to dark mode automatically */
    border: 4px solid var(--bg-body);
    overflow: hidden;
    transition: transform 0.2s;
}

.nav-item-center:active {
    transform: scale(0.95);
}

.nav-home-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-home-placeholder {
    width: 100%;
    height: 100%;
    background: var(--brand-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Profile dropup — must appear ABOVE the bottom nav */
.app-bottom-nav .dropup .dropdown-menu {
    z-index: 1060 !important;
}

/* Profile trigger — styled as nav-item, but is a <button> */
.app-bottom-nav .nav-profile-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    padding-bottom: 12px;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s ease;
}
.app-bottom-nav .nav-profile-trigger i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}
.app-bottom-nav .nav-profile-trigger:hover,
.app-bottom-nav .nav-profile-trigger:focus {
    color: var(--brand-primary);
    outline: none;
    box-shadow: none;
}
.app-bottom-nav .nav-profile-trigger:active {
    transform: scale(0.95);
}

/* Dropup container must fill its grid cell */
.app-bottom-nav .nav-item.dropup {
    position: relative;
}

/* ========================================= */
/* 6. RESPONSIVE UTILITIES                   */
/* ========================================= */
@media (max-width: 480px) {
    .register-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    .display-4 {
        font-size: 2rem;
    }
}
/* ... existing code ... */

/* ========================================= */
/* 7. SMART TEXT VISIBILITY FIXES            */
/* ========================================= */

/* Forces text to show 3 lines then ... */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal; /* Overrides 'nowrap' which causes invisible text */
    min-height: 4.5em;   /* Reserve space so cards align evenly */
}

/* Force description color to be visible in all modes */
.service-desc-fix {
    color: var(--text-muted) !important;
}

/* Dark mode specific override if needed */
body.theme-dark .service-desc-fix {
    color: var(--text-muted) !important;
}
.step-indicator {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}
.counter-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: background-color 0.15s ease;
}
.counter-btn:hover {
    background-color: #f3f4f6;
}