/* PTC Aviation Training CRM - Main Stylesheet */

:root {
    --primary-blue: #0066cc;
    --primary-dark: #003366;
    --secondary-gold: #ffc107;
    --accent-sky: #87ceeb;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff10" fill-opacity="1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    opacity: 0.1;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    padding: 1rem;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.login-card.compact {
    padding: 1.5rem;
    max-height: 95vh;
    overflow-y: auto;
}

.login-card.compact .login-header {
    margin-bottom: 1rem;
}

.login-card.compact .login-header .logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
}

.login-card.compact h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.login-card.compact .mb-3 {
    margin-bottom: 0.75rem !important;
}

.login-card.compact .demo-user-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.login-card.compact .user-group {
    gap: 0.35rem;
}

.login-card.compact .demo-users {
    gap: 0.75rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
}

.login-header .logo i {
    font-size: 2.5rem;
    color: var(--text-light);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.login-header .tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Styles */
.login-form .form-label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.login-form .form-label i {
    margin-right: 0.5rem;
    color: var(--primary-blue);
}

.login-form .form-control {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 1rem;
    transition: var(--transition);
}

.login-form .form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.login-form .form-check-label {
    color: var(--text-muted);
}

.btn-login {
    padding: 0.85rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    border: none;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #0077ee 0%, var(--primary-dark) 100%);
}

.btn-login i {
    margin-right: 0.5rem;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.login-footer .fa-shield-alt {
    color: #28a745;
    margin-right: 0.3rem;
}

.demo-credentials {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.demo-credentials strong {
    display: block;
    margin-bottom: 1rem;
    color: var(--secondary-gold);
    font-size: 0.95rem;
    text-align: center;
}

.demo-users {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.25rem;
}

.demo-user-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-width: 1px;
    transition: var(--transition);
}

.demo-user-btn:hover {
    transform: translateX(4px);
}

.demo-user-btn small {
    opacity: 0.7;
    font-size: 0.75rem;
}

.demo-credentials code {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Powered By */
.powered-by {
    margin-top: 2rem;
    text-align: center;
}

.powered-by p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.powered-by .brand {
    font-weight: bold;
}

.powered-by .x { color: #339966; }
.powered-by .dot { color: #ff6600; }
.powered-by .one { color: #339966; }

/* Error Alert */
.alert-danger {
    background-color: #fff5f5;
    border-color: #fed7d7;
    color: #c53030;
}

/* Dashboard Styles */
.dashboard-page {
    background: #f4f6f9;
    min-height: 100vh;
}

.dashboard-nav {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
}

.dashboard-nav .navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.dashboard-nav .navbar-brand i {
    margin-right: 0.5rem;
}

/* Sidebar */
.sidebar {
    background: var(--primary-dark);
    min-height: calc(100vh - 56px);
    width: 250px;
    position: fixed;
    left: 0;
    top: 56px;
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.sidebar .nav-link.active {
    border-left: 3px solid var(--secondary-gold);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 2rem;
}

/* Dashboard Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-light);
}

.stat-card .icon.bg-primary { background: var(--primary-blue); }
.stat-card .icon.bg-success { background: #2e7d32; } /* Dark Green - Enrolled */
.stat-card .icon.bg-success-light { background: #66bb6a; } /* Middle Green - Qualified */
.stat-card .icon.bg-orange { background: #ff6b35; } /* Orange - New */
.stat-card .icon.bg-warning { background: var(--secondary-gold); color: var(--primary-dark); }
.stat-card .icon.bg-info { background: #64b5f6; } /* Light Blue - Total */

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin: 0.5rem 0;
}

.stat-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* Prospect Table */
.prospects-table {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.prospects-table .table {
    margin: 0;
}

.prospects-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-blue);
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Funnel-based color scheme: Dark Orange → Light Orange → Yellow → Light Green → Dark Green */
.status-badge.new { background: #ff6b35; color: white; } /* Dark Orange - New lead */
.status-badge.contacted { background: #ff8c42; color: white; } /* Medium Orange - First contact */
.status-badge.proposal { background: #ffa552; color: white; } /* Light Orange - Proposal sent */
.status-badge.qualified { background: #ffbe62; color: #5d4e00; } /* Yellow-Orange - Qualified/Subic invite */
.status-badge.negotiation { background: #c8e6c9; color: #2e7d32; } /* Light Green - Subic visit done */
.status-badge.enrolled { background: #2e7d32; color: white; } /* Dark Green - Training started */
.status-badge.deferred { background: #fce4ec; color: #ec407a; } /* Pink - Deferred */
.status-badge.lost { background: #e0e0e0; color: #424242; } /* Light Grey bg, Dark Grey text - Lost */

/* Role-based badge colors (matching login page button colors) */
.badge.role-sales { background: #0d6efd !important; color: white !important; } /* Bootstrap primary blue */
.badge.role-management { background: #198754 !important; color: white !important; } /* Bootstrap success green */
.badge.role-admin { background: #dc3545 !important; color: white !important; } /* Bootstrap danger red */

/* Search and Filter Styles */
.search-box {
    position: relative;
}

.search-box input[type="search"] {
    padding-left: 2.5rem;
    transition: var(--transition);
}

.search-box input[type="search"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.status-filter-select {
    width: auto;
    min-width: 150px;
}

.table-row-highlight {
    background-color: #fffbea !important;
    animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
    from { background-color: #fff3cd; }
    to { background-color: transparent; }
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* AI Insights Panel */
.ai-insights {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    color: var(--text-light);
}

.ai-insights h4 {
    display: flex;
    align-items: center;
}

.ai-insights h4 i {
    margin-right: 0.75rem;
}

.ai-insights .insight-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.ai-insights .insight-item h5 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.ai-insights .insight-item h5 i {
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 1000;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* Planning Wizard Styles */
.wizard-container {
    max-width: 800px;
}

.wizard-avatar {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.main-content-padded {
    padding-top: 76px;
}
