﻿/* Modern Dashboard Styles */

.modern-dashboard {
    min-height: 90vh;
    background-color: transparent;
}

/* Header Styles */
.dashboard-header {
    background: linear-gradient(135deg, #E8EBF0 0%, #B8C5D6 100%);
    color: #00317e; /* Dark blue text for contrast */
    padding: 0rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    padding-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    color: #00317eaa;
    margin: 0.25rem 0 0 0.0rem;
}

.user-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-dropdown {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    min-width: 200px;
}

    .user-dropdown option {
        background: #4a5568;
        color: white;
    }

/* Main Content */
.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header-modern {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

    .card-header-modern h5 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #495057;
    }

/* On-Call Card Header - home button styling */
.oncall-card .card-header-modern {
    position: relative;
}

    .oncall-card .card-header-modern h5 > span {
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
        padding: 0.35rem 0.5rem;
        border-radius: 6px;
        border: 1px solid #d0d5dd;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        transition: all 0.2s;
        background: white;
    }

        .oncall-card .card-header-modern h5 > span:hover {
            border-color: #667eea;
            box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);
        }

/* Profile Card */
.profile-card .profile-content {
    padding-left: 1.5rem;
    padding-right: .75rem;
    padding-top: 0.2rem;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0rem;
}

.profile-title {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 0.0rem;
}

.profile-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.02rem;
    color: #4a5568;
}

    .profile-location a {
        color: #667eea;
        text-decoration: none;
    }

        .profile-location a:hover {
            text-decoration: underline;
        }

.birthday-alert {
    background: #fef3c7;
    color: #92400e;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-contact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #4a5568;
}

    .profile-contact span {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

.profile-team {
    font-size: 0.9rem;
    color: #4a5568;
}

    .profile-team > div {
        margin-bottom: 0.10rem;
    }

/* Drive Time Card */
.drive-time-card .drive-time-content {
    padding: 0.5rem;
}

.time-display {
    text-align: center;
}

    .time-display i {
        font-size: 2rem;
        color: #667eea;
        display: block;
    }

.time-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.drive-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.9rem;
}

    .drive-details > div {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #4a5568;
    }

.route-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.route-point {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

    .route-point strong {
        color: #2d3748;
    }

    .route-point small {
        color: #718096;
    }

/* On Call Card */
.oncall-card .oncall-controls {
    padding: .3rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.oncall-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

    .oncall-controls button:hover:not(:disabled) {
        background: #5a67d8;
    }

    .oncall-controls button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.zone-select {
    flex: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.oncall-list {
    padding: 0 1.5rem 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.oncall-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .oncall-item:last-child {
        border-bottom: none;
    }

    .oncall-item .tech-name {
        font-weight: 400;
        color: #2d3748;
        margin-right: auto;
    }

    .oncall-item .schedule {
        color: #718096;
        font-size: 0.85rem;
    }

.no-oncall {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 2rem 0;
}

/* Section Dividers */
.section-divider {
    margin: 3rem 0 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Quick Links Grid */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-link-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

    .quick-link-card:hover {
        border-color: #667eea;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
        color: #667eea;
        text-decoration: none;
    }

    .quick-link-card i {
        font-size: 2rem;
        color: #667eea;
    }

    .quick-link-card span {
        font-weight: 500;
    }


/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Chart Container */
#barChartCanvas {
    padding: 1rem;
}

/* Scrollbar Styling */
.oncall-list::-webkit-scrollbar {
    width: 6px;
}

.oncall-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.oncall-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

    .oncall-list::-webkit-scrollbar-thumb:hover {
        background: #999;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem 0;
    }

    .header-content {
        padding: 0 1rem;
    }

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

    .dashboard-subtitle {
        font-size: 0.9rem;
    }

    .user-dropdown {
        min-width: 150px;
        font-size: 0.9rem;
    }

    .dashboard-content {
        padding: 1.5rem 1rem;
    }

    .metrics-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .quick-link-card {
        padding: 1rem;
    }

        .quick-link-card i {
            font-size: 1.5rem;
        }

        .quick-link-card span {
            font-size: 0.85rem;
        }

    .quote-footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }

    .time-value {
        font-size: 1.5rem;
    }

    .profile-name {
        font-size: 1.25rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}


/* Add this to your IndexModern.css file - Chart Container Sizing */

/* Chart Container - Add specific sizing constraints */
.metric-card .chart-container {
    position: relative;
    height: 310px; /* Fixed height */
    width: 100%;
    padding: 1rem;
    overflow: hidden; /* Prevent overflow */
}

#barChartCanvas {
    max-height: 280px !important; /* Enforce maximum height */
    max-width: 100% !important; /* Enforce maximum width */
    height: 280px !important; /* Fixed height */
    width: 100% !important; /* Full width of container */
}

/* Ensure the metric card containing the chart has proper constraints */
.metric-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* This is important to prevent chart overflow */
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 300px; /* Minimum height for chart cards */
}

    /* Specific styling for chart cards */
    .metric-card:has(#barChartCanvas) {
        display: flex;
        flex-direction: column;
    }

        .metric-card:has(#barChartCanvas) .card-header-modern {
            flex-shrink: 0; /* Don't shrink the header */
        }

        .metric-card:has(#barChartCanvas) .chart-container {
            flex-grow: 1; /* Take remaining space */
            display: flex;
            align-items: center;
            justify-content: center;
        }

/* Dispatch Lookup Widget Container */
.dispatch-lookup-widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

    .dispatch-lookup-widget:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.dispatch-lookup-inner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.dispatch-lookup-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #667eea;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .dispatch-lookup-icon i {
        font-size: 1.4rem;
        color: white;
    }

.dispatch-lookup-content {
    flex: 1;
    min-width: 0;
}

.dispatch-lookup-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.2rem;
}

.dispatch-lookup-subtitle {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.dispatch-input-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 320px;
}

.dispatch-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    min-width: 0;
}

    .dispatch-input:focus {
        outline: none;
        border-color: #0d6efd;
    }

    .dispatch-input::placeholder {
        color: #a0aec0;
    }

    .dispatch-input:disabled {
        background: #f7fafc;
    }

.dispatch-go-btn {
    width: 44px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

    .dispatch-go-btn:hover:not(:disabled) {
        background: #0b5ed7;
    }

    .dispatch-go-btn:active:not(:disabled) {
        transform: scale(0.97);
    }

    .dispatch-go-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .dispatch-go-btn i {
        font-size: 1.1rem;
    }

/* Message styles */
.dispatch-message {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0;
}

    .dispatch-message.error {
        color: #e53e3e;
    }

    .dispatch-message.success {
        color: #38a169;
    }

    .dispatch-message i {
        flex-shrink: 0;
        font-size: 0.85rem;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Keep dispatch widget at 2 columns on mobile */
    .dispatch-lookup-widget {
        grid-column: span 2 !important;
        padding: 1.25rem;
    }

    .dispatch-lookup-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

        .dispatch-lookup-icon i {
            font-size: 1.2rem;
        }

    .dispatch-input-row {
        max-width: none;
    }

    .dispatch-input {
        padding: 0.7rem 0.9rem;
    }

    .dispatch-go-btn {
        width: 50px;
    }
}

/* Tablet - keep double width */
@media (min-width: 769px) and (max-width: 1024px) {
    .dispatch-lookup-widget {
        grid-column: span 2;
    }
}
