/* Agency Pulse - Custom Light Theme Styles */
:root {
    --primary-blue: #1877f2;
    --insight-blue: #182a35;
    --accent-orange: #f7630c;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --success-green: #198754;
    --warning-yellow: #ffc107;
    --danger-red: #dc3545;
    --info-cyan: #0dcaf0;
    --white: #ffffff;
    --black: #000000;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
}

/* Dashboard Metric Cards - Insight Blue Theme */
.bg-insight-blue {
    background-color: var(--insight-blue) !important;
    color: #ffffff !important;
}

.bg-insight-blue h3,
.bg-insight-blue h5,
.bg-insight-blue h6,
.bg-insight-blue small,
.bg-insight-blue .card-title {
    color: #ffffff !important;
}

.bg-insight-blue i {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: #333;
    line-height: 1.6;
}

/* Navigation Enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-blue) !important;
}

.navbar-light .navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-blue) !important;
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-blue) !important;
    font-weight: 600;
}

/* Button Enhancements */
.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: #1664d8;
    border-color: #1664d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-1px);
}

/* Orange accent buttons */
.btn-warning {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: white;
}

.btn-warning:hover {
    background-color: #e55a0a;
    border-color: #e55a0a;
    color: white;
}

.btn-outline-warning {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
}

.btn-outline-warning:hover {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: white;
}

/* Card Enhancements */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease-in-out;
    background-color: var(--white);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: #333;
}

.card-footer {
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

/* Badge Styling */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bg-primary {
    background-color: var(--primary-blue) !important;
}

.text-primary {
    color: var(--primary-blue) !important;
}

/* Form Enhancements */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.25);
}

.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.25);
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid var(--success-green);
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid var(--danger-red);
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid var(--warning-yellow);
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
    border-left: 4px solid var(--info-cyan);
}

/* Dashboard Specific Styles */
.dashboard-metric-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    color: white;
    transition: transform 0.2s ease-in-out;
}

.dashboard-metric-card:hover {
    transform: scale(1.02);
}

.dashboard-metric-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Agency List Styles */
.agency-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid var(--border-color);
}

.agency-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.15);
}

/* Star Rating Styles */
.star-rating {
    color: var(--warning-yellow);
}

.star-rating .fa-star {
    margin-right: 2px;
}

/* Progress Bar Enhancements */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--medium-gray);
}

.progress-bar {
    border-radius: 0.25rem;
    transition: width 0.6s ease;
}

/* Project Card Specific Styles */
.project-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-in-out;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.project-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-card .progress {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
    overflow: hidden;
}

.project-card .progress-bar {
    border-radius: 5px;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.project-card .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.project-card .card-body {
    padding: 1.5rem;
}

.project-card .card-title a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.project-card .card-title a:hover {
    color: var(--primary-blue);
}

.project-card .metrics-section {
    background: rgba(24, 119, 242, 0.03);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(24, 119, 242, 0.1);
}

.project-card .metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
}

.project-card .metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Enhancements */
.table {
    background-color: var(--white);
}

.table-hover tbody tr:hover {
    background-color: rgba(24, 119, 242, 0.05);
}

.table th {
    border-top: none;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: #333;
    background-color: var(--light-gray);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-blue);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.pagination .page-link:hover {
    color: #1664d8;
    background-color: var(--light-gray);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-gray);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--light-gray);
}

/* Dropdown Enhancements */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

/* Footer Styles */
footer {
    background-color: var(--white) !important;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* User Type Badges */
.badge.bg-secondary {
    background-color: var(--dark-gray) !important;
}

/* Custom utility classes */
.text-preserve-whitespace {
    white-space: pre-wrap;
}

.border-primary {
    border-color: var(--primary-blue) !important;
}

.border-warning {
    border-color: var(--accent-orange) !important;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-primary {
    color: var(--primary-blue);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .dashboard-metric-card h3 {
        font-size: 2rem;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Milestone Timeline Styles */
.milestone-timeline {
    position: relative;
    padding: 20px 0;
}

.milestone-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-left: 60px;
}

.milestone-step:last-child {
    margin-bottom: 0;
}

.timeline-line {
    position: absolute;
    left: 24px;
    top: -30px;
    width: 3px;
    height: 30px;
    background-color: var(--medium-gray);
    transition: background-color 0.3s ease;
}

.timeline-line.completed {
    background-color: var(--success-green);
}

.milestone-circle {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.milestone-step.completed .milestone-circle {
    background-color: var(--success-green);
    color: white;
    border: 3px solid var(--success-green);
}

.milestone-step.pending .milestone-circle {
    background-color: var(--white);
    color: var(--dark-gray);
    border: 3px solid var(--medium-gray);
}

.milestone-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.milestone-step.completed .milestone-circle:hover {
    background-color: #157347;
    border-color: #157347;
}

.milestone-step.pending .milestone-circle:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.milestone-content {
    flex: 1;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-left: 16px;
    transition: all 0.3s ease;
}

.milestone-step.completed .milestone-content {
    border-color: var(--success-green);
    background-color: rgba(25, 135, 84, 0.02);
}

.milestone-content:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.1);
}

.milestone-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.milestone-step.completed .milestone-title {
    color: var(--success-green);
}

.milestone-meta {
    margin-bottom: 8px;
}

.milestone-meta small {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 4px;
}

.milestone-description {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.milestone-number {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsive adjustments for timeline */
@media (max-width: 768px) {
    .milestone-step {
        padding-left: 50px;
    }
    
    .milestone-circle {
        width: 40px;
        height: 40px;
    }
    
    .milestone-content {
        margin-left: 12px;
        padding: 12px;
    }
    
    .milestone-title {
        font-size: 1rem;
    }
    
    .timeline-line {
        left: 19px;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* Print styles */
@media print {
    .btn,
    .navbar,
    .card-footer,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
