/* Kilifi PMTS - Main Stylesheet */

:root {
    --primary: #2C6E49;
    --primary-dark: #1A4B3A;
    --secondary: #F4A261;
    --light-bg: #F8F9FA;
    --dark-text: #2D3748;
    --success: #38A169;
    --warning: #D69E2E;
    --danger: #E53E3E;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44, 110, 73, 0.25);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: #e8994a;
    border-color: #e8994a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244, 162, 97, 0.25);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: var(--primary);
    color: white;
    padding: 16px 24px;
    font-weight: 600;
    border: none;
}

/* Project Cards */
.project-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    position: relative;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.project-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.project-card .card-body {
    padding: 20px;
}

.project-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.project-card .project-status {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-planned { background: #E2E8F0; color: #4A5568; }
.status-ongoing { background: #FEF3C7; color: #92400E; }
.status-completed { background: #D1FAE5; color: #065F46; }
.status-delayed { background: #FEE2E2; color: #991B1B; }
.status-suspended { background: #E5E7EB; color: #6B7280; }

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #EDF2F7;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), #48BB78);
    border-radius: 4px;
    transition: width 1.5s ease;
}

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-secondary {
    background-color: #E5E7EB;
    color: #6B7280;
}

/* Navigation */
.navbar {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand span {
    color: var(--primary);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-text);
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background-color: rgba(44, 110, 73, 0.08);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(44, 110, 73, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-section h1 {
    color: white;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Stats Section */
.stats-section {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #EDF2F7;
}

.stat-item {
    text-align: center;
}

.stat-item .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-item .label {
    color: #718096;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Feedback Section */
.feedback-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary);
}

.feedback-item .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feedback-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Map */
#project-map {
    height: 500px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* DataTables */
.dataTables_wrapper {
    padding: 16px 0;
}

.dataTables_length select,
.dataTables_filter input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    padding: 12px 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark-text);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 16px 20px;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Admin Panel Styles */
.admin-sidebar {
    background: var(--primary-dark);
    min-height: 100vh;
    padding: 20px 0;
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 8px;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
}

.admin-content {
    padding: 24px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .admin-sidebar {
        min-height: auto;
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .stat-item .number {
        font-size: 1.8rem;
    }
    
    #project-map {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .project-card .card-img-top {
        height: 150px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 12px 20px;
    margin-bottom: 8px;
    background: white;
    min-width: 300px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(44, 110, 73, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F1F1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Kilifi Logo Styles */
.navbar-brand img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.hero-section .logo-container img {
    max-height: 100px;
    width: auto;
}

/* PMTS Blue Color - Matching Kilifi Logo */
.text-pmts-blue {
    color: #1a5276;
}

/* Responsive logo */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 35px;
    }
    .hero-section .logo-container img {
        max-height: 60px;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 30px;
    }
    .hero-section .logo-container img {
        max-height: 50px;
    }
}