/* BusOps AI - Custom Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Navigation Active State */
.nav-item {
    color: #9ca3af;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: #ffffff;
}

.nav-item.active {
    background-color: #2563eb;
    color: #ffffff;
}

/* Card Styling */
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #475569;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.stat-card.success::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-primary {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.badge-gray {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* Button Styles */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-secondary {
    background-color: #475569;
    color: white;
}

.btn-secondary:hover {
    background-color: #334155;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #475569;
    color: #e5e7eb;
}

.btn-outline:hover {
    background-color: #1e293b;
    border-color: #64748b;
}

/* Gantt Chart Styles */
#ganttChart {
    min-height: 600px;
    position: relative;
}

.gantt-timeline {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0;
}

.gantt-sidebar {
    background: #1e293b;
    border-right: 2px solid #334155;
    position: sticky;
    left: 0;
    z-index: 10;
}

.gantt-grid {
    position: relative;
    overflow-x: auto;
}

.gantt-header {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    background: #0f172a;
    border-bottom: 2px solid #334155;
    position: sticky;
    top: 0;
    z-index: 5;
}

.gantt-hour {
    padding: 1rem;
    text-align: center;
    border-right: 1px solid #334155;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.gantt-row {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    min-height: 80px;
    border-bottom: 1px solid #334155;
    position: relative;
    background: repeating-linear-gradient(
        90deg,
        #0f172a,
        #0f172a 4.1666%,
        #1e293b 4.1666%,
        #1e293b 4.1667%
    );
}

.gantt-label {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid #334155;
    min-height: 80px;
    background: #1e293b;
}

.gantt-label-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.875rem;
}

.gantt-label-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Operation Block (Draggable) */
.operation-block {
    position: absolute;
    height: 60px;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: move;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    user-select: none;
}

.operation-block.dragging {
    opacity: 0.8;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.operation-block.can-drop {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.operation-block.cannot-drop {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.operation-block-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.operation-block-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Compliance Tooltip */
.compliance-tooltip {
    position: absolute;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.75rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    display: none;
    pointer-events: none;
}

.compliance-tooltip.show {
    display: block;
}

.compliance-tooltip.success {
    border-color: #10b981;
}

.compliance-tooltip.danger {
    border-color: #ef4444;
}

/* Map Container */
#mapContainer {
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
}

/* Mobile View Styles */
.mobile-frame {
    max-width: 375px;
    margin: 0 auto;
    background: #000000;
    border-radius: 40px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mobile-screen {
    background: #0f172a;
    border-radius: 20px;
    overflow: hidden;
    height: 667px;
    display: flex;
    flex-direction: column;
}

.mobile-header {
    padding: 1rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Status Indicator */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.active {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse-green 2s infinite;
}

.status-indicator.warning {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.status-indicator.danger {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    }
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #334155;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    #sidebar {
        position: fixed;
        left: -100%;
        z-index: 50;
        height: 100vh;
    }
    
    #sidebar.open {
        left: 0;
    }
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: #1e293b;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #334155;
    color: #e5e7eb;
}

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

.data-table tbody tr:hover {
    background-color: #1e293b;
}

/* Input Styles */
.input {
    width: 100%;
    padding: 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input::placeholder {
    color: #64748b;
}

/* Select Dropdown */
.select {
    width: 100%;
    padding: 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
