/**
 * SideGigs Academy - Main Stylesheet
 * 
 * Color Scheme:
 * - Primary: #2F3C7E (Deep Blue)
 * - Secondary: #1D1B1B (Dark)
 * - Light Background: #FBEAEB (Soft Pink)
 * 
 * Fonts:
 * - Headings: Bree Serif
 * - Body: Outfit
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
    --primary-color: #2F3C7E;
    --secondary-color: #1D1B1B;
    --light-bg: #FBEAEB;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    --font-heading: 'Bree Serif', serif;
    --font-body: 'Outfit', sans-serif;
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 5px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--gray-100);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.25rem; }
h5, .h5 { font-size: 1.1rem; }
h6, .h6 { font-size: 1rem; }

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ============================================================================
   NAVBAR STYLES
   ============================================================================ */
.navbar {
    padding: 0.75rem 0;
    box-shadow: var(--box-shadow);
    z-index: 1030;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
}
/*
.navbar-brand img {
    filter: brightness(0) invert(1);
}*/

.navbar .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
}

.navbar .dropdown-item:hover {
    background-color: var(--light-bg);
}

/* ============================================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1020;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: var(--transition);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary-color);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

/* Add padding to body when mobile nav is present */
@media (max-width: 991.98px) {
    body.has-mobile-nav {
        padding-bottom: 70px;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #252f63;
    color: var(--white);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #0d0c0c;
    color: var(--white);
}

.btn-light {
    background-color: var(--light-bg);
    color: var(--secondary-color);
}

.btn-light:hover {
    background-color: #f5d5d7;
    color: var(--secondary-color);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Full width button on mobile */
@media (max-width: 575.98px) {
    .btn-mobile-full {
        width: 100%;
    }
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    background: var(--white);
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-img-top {
    height: 180px;
    object-fit: cover;
    background-color: var(--gray-200);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.card-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Blueprint Card Specific */
.blueprint-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blueprint-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blueprint-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.blueprint-card .price-tag {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary-color);
}

.blueprint-card .metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.blueprint-card .metric-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--gray-100);
    border-radius: 4px;
    color: var(--gray-600);
}

.blueprint-card .metric-badge i {
    margin-right: 0.25rem;
    color: var(--primary-color);
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-control,
.form-select {
    font-family: var(--font-body);
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 60, 126, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.form-text {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* Input group styling */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Checkbox and Radio styling */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--gray-300);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(47, 60, 126, 0.15);
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
    font-family: var(--font-body);
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-lg {
    height: 12px;
}

/* Circular Progress */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle .progress-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.progress-circle .progress-bar-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--secondary-color);
}

/* ============================================================================
   MILESTONE & CHECKLIST STYLES
   ============================================================================ */
.milestone-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
}

.milestone-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.milestone-number {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.milestone-number.completed {
    background-color: var(--success);
}

.milestone-title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0;
}

.milestone-toggle {
    color: var(--gray-500);
    transition: var(--transition);
}

.milestone-header[aria-expanded="true"] .milestone-toggle {
    transform: rotate(180deg);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    background-color: var(--gray-100);
    transition: var(--transition);
    cursor: pointer;
}

.checklist-item:hover {
    background-color: var(--light-bg);
}

.checklist-item.completed {
    background-color: rgba(40, 167, 69, 0.1);
}

.checklist-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.checklist-item.completed .checklist-checkbox {
    background-color: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.checklist-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.checklist-item.completed .checklist-text {
    text-decoration: line-through;
    color: var(--gray-600);
}

/* Locked milestone overlay */
.milestone-locked {
    position: relative;
    opacity: 0.7;
}

.milestone-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
}

.milestone-locked .lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-align: center;
}

/* ============================================================================
   ALERTS
   ============================================================================ */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.15);
    color: #0c5460;
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */
.auth-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--white) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    padding: 2rem;
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card .logo img {
    height: 60px;
}

.auth-card h1 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* ============================================================================
   DASHBOARD STYLES
   ============================================================================ */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e2a5e 100%);
    color: var(--white);
    padding: 2rem 0;
    margin-bottom: 2rem;
    margin-top: -1rem;
}

.dashboard-header h1 {
    color: var(--white);
    font-size: 1.5rem;
}

.dashboard-header .welcome-text {
    opacity: 0.9;
    font-size: 0.95rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    background-color: var(--light-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--secondary-color);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ============================================================================
   BLUEPRINT DETAIL PAGE
   ============================================================================ */
.blueprint-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e2a5e 100%);
    color: var(--white);
    padding: 2rem 0;
    margin-top: -1rem;
}

.blueprint-hero h1 {
    color: var(--white);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.blueprint-hero .elevator-pitch {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.blueprint-hero .metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.blueprint-hero .metric-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
}

.blueprint-hero .metric-item i {
    margin-right: 0.5rem;
}

.purchase-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow-lg);
    position: sticky;
    top: 90px;
}

.purchase-card .price {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.purchase-card .features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.purchase-card .features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.purchase-card .features li:last-child {
    border-bottom: none;
}

.purchase-card .features li i {
    color: var(--success);
}

/* ============================================================================
   SEARCH & FILTER
   ============================================================================ */
.search-bar {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-pill {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--primary-color);
    color: var(--white);
}

/* ============================================================================
   ADMIN STYLES
   ============================================================================ */
.admin-sidebar {
    background: var(--secondary-color);
    min-height: calc(100vh - 70px);
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.admin-content {
    padding: 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Data Tables */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table {
    margin-bottom: 0;
    background: var(--white);
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

/* ============================================================================
   PAYMENT MODAL
   ============================================================================ */
.payment-modal .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
}

.payment-modal .modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.payment-modal .modal-body {
    padding: 1.5rem;
}

.payment-modal .mpesa-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.payment-modal .phone-input {
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 2px;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-light-pink { background-color: var(--light-bg) !important; }

.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.shadow-custom { box-shadow: var(--box-shadow) !important; }
.shadow-custom-lg { box-shadow: var(--box-shadow-lg) !important; }

/* Spacing helpers */
.section-padding { padding: 2rem 0; }
.section-padding-lg { padding: 3rem 0; }

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */
@media (max-width: 991.98px) {
    /* Hide desktop navbar on mobile */
    .navbar-collapse {
        background: var(--primary-color);
        padding: 1rem;
        margin: 0.5rem -0.75rem -0.75rem;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
    
    .dashboard-header {
        padding: 1.5rem 0;
    }
    
    .blueprint-hero {
        padding: 1.5rem 0;
    }
    
    .blueprint-hero h1 {
        font-size: 1.5rem;
    }
    
    .purchase-card {
        position: static;
        margin-top: 1.5rem;
    }
    
    /* Admin sidebar becomes top nav on mobile */
    .admin-sidebar {
        min-height: auto;
        padding: 0.5rem;
    }
    
    .admin-sidebar .nav {
        flex-direction: row;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .admin-sidebar .nav-link {
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.35rem; }
    h3, .h3 { font-size: 1.2rem; }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .milestone-card {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .navbar,
    .mobile-bottom-nav,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
