/* Custom CSS for Consulting Management Tool */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-bottom: 3rem;
}

/* Navigation Styles */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 4px;
    padding: 8px 16px !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: white;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.stat-card .card-body {
    padding-left: 2rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.1;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background-color: var(--secondary-color);
    border: none;
}

.btn-warning {
    background-color: var(--accent-color);
    border: none;
}

.btn-danger {
    background-color: var(--danger-color);
    border: none;
}

/* Badges */
.badge {
    padding: 0.5em 0.875em;
    font-weight: 600;
    border-radius: 6px;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

.table td {
    vertical-align: middle;
    padding: 1rem;
}

/* Client/Project Cards */
.client-card, .project-card {
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

.client-card:hover, .project-card:hover {
    border-left-color: var(--secondary-color);
}

.client-name, .project-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.client-email, .project-status {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.hourly-rate {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--border-color);
}

.progress-bar {
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Status Indicators */
.status-active {
    color: var(--secondary-color);
}

.status-completed {
    color: var(--text-muted);
}

.status-overdue {
    color: var(--danger-color);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Page Header */
.page-header {
    background: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Footer */
.footer {
    background-color: white !important;
    margin-top: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile navbar adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-nav .nav-link {
        padding: 12px 16px !important;
        margin: 4px 0;
    }

    /* Card adjustments for mobile */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
        font-size: 0.95rem;
    }

    /* Table improvements for mobile */
    .table {
        font-size: 0.875rem;
    }

    .table td, .table th {
        padding: 0.75rem 0.5rem;
    }

    /* Badge adjustments */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
    }

    /* Button adjustments */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
    }

    /* Stat card icon - reduce size on mobile */
    .stat-icon {
        font-size: 2rem;
    }

    /* Client info card on invoice creation */
    .client-name, .project-name {
        font-size: 1.1rem;
    }

    .hourly-rate {
        font-size: 1.25rem;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
    .page-header {
        padding: 1.5rem 0;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    /* Stack columns on very small screens */
    .col-lg-4, .col-lg-8, .col-md-6 {
        margin-bottom: 1rem;
    }

    /* Hide table columns on very small screens - show only essential info */
    .table thead th:nth-child(3),
    .table tbody td:nth-child(3) {
        display: none; /* Hide Project column on very small screens */
    }

    /* Adjust footer text stacking */
    .footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 0.5rem;
    }

    /* Smaller stat cards */
    .stat-value {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Invoice creation - stack buttons vertically on small screens */
    .btn-lg {
        width: 100%;
        font-size: 0.95rem;
    }

    /* Make work log descriptions truncate on mobile */
    .table tbody td:nth-child(4) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Landscape phones and tablets */
@media (min-width: 576px) and (max-width: 992px) {
    /* Adjust invoice creation columns for tablets */
    .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 1.125rem;
}
