/* DAJA-data Custom Styles */

/* Override base.css background */
html {
    background-color: #ffffff;
}

body {
    background-color: #ffffff;
    padding: 0;
    height: 100vh;
    font-family: var(--font);
}

a {
    color: #213857;
}
a:hover {
    color: #4b83c8;
}

/* Login Page Styles */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #ffffff;
}

.login-container {
    background-color: #f3f3f3;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    border: 1px solid #dddddd;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #213857;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    letter-spacing: 2px;
}

.login-header h2 {
    color: #787878;
    font-size: 1.2rem;
    font-weight: normal;
    margin: 0;
}

/* Form styles */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #000000;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #213857;
    box-shadow: 0 0 0 2px #21385799;
}

.form-group input:disabled {
    background-color: #f7f7f7;
    color: #787878;
}

/* Button styles */
.btn {
    background-color: rgb(55, 95, 146);
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background-color: #4b83c8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn.w100 {
    width: 100%;
}

/* Links */
.links {
    text-align: center;
    margin-top: 1rem;
}

.links a {
    text-decoration: none;
    font-size: 0.9rem;
}

.links a:hover {
    text-decoration: none;
}

/* Message box */
.message-box {
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.message-box.error {
    background-color: #fff5f5;
    border: 1px solid #ffdddd;
    color: #d8000c;
}

.message-box.success {
    background-color: #f0fff4;
    border: 1px solid #d4f7d4;
    color: #4caf50;
}

/* Form hints */
.form-hint {
    display: block;
    margin-top: 0.3rem;
    color: #787878;
    font-size: 0.8rem;
}

/* Admin Page Styles */
.admin-container {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f3f3f3;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border: 1px solid #dddddd;
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    color: #213857;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    background-color: #ffffff;
    color: #213857;
    font-size: 0.9rem;
    cursor: pointer;
}

.logout-btn {
    background-color: #213857;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #1a2d47;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dashboard Content */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.metric-card {
    background-color: #f3f3f3;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dddddd;
    text-align: center;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #213857;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.9rem;
    color: #787878;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-change.positive {
    color: #4caf50;
}

.metric-change.negative {
    color: #f44336;
}

/* Main Content Row */
.main-content-row {
    display: grid;
    grid-template-columns: 3.1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Map Section */
.map-section {
    background-color: #f3f3f3;
    border-radius: 6px;
    border: 1px solid #dddddd;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: #ffffff;
    border-bottom: 1px solid #dddddd;
}

.section-header h2, .section-header h3 {
    margin: 0;
    color: #213857;
    font-size: 1rem;
    font-weight: 600;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

.map-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #d1d1d1;
    background-color: #ffffff;
    color: #787878;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-btn.active, .map-btn:hover {
    background-color: #f7d107;
    color: #213857;
    border-color: #f7d107;
}

.map-container {
    position: relative;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
}

#region-map {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    pointer-events: none;
}

.map-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.2s ease;
}

.map-marker:hover {
    transform: scale(1.3);
}

.map-marker.route {
    background-color: #213857;
}

.map-marker.poi {
    background-color: #f7d107;
}

.map-marker.high-frequency {
    background-color: #4caf50;
}

.map-marker.medium-frequency {
    background-color: #ff9800;
}

.map-marker.low-frequency {
    background-color: #f44336;
}

/* Data Panel */
.data-panel {
    background-color: #f3f3f3;
    border-radius: 6px;
    border: 1px solid #dddddd;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.data-selection {
    padding: 0.5rem;
    background-color: #ffffff;
    overflow-y: auto;
    flex: 1;
}

.data-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.data-item:hover {
    background-color: #f8f8f8;
}

.data-item.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #213857;
}

.data-item input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

.data-item-info {
    flex: 1;
}

.data-item-name {
    font-weight: 500;
    color: #213857;
    font-size: 0.8rem;
}

.data-item-details {
    font-size: 0.7rem;
    color: #787878;
    margin-top: 0.1rem;
}

.selection-summary {
    background-color: #f8f8f8;
    padding: 0.6rem 0.8rem;
    border-top: 1px solid #dddddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.8rem;
    color: #787878;
}

.summary-value {
    font-weight: bold;
    color: #213857;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    background-color: #213857;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background-color: #f7d107;
    border-color: #f7d107;
    color: #213857;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.chart-section {
    background-color: #f3f3f3;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dddddd;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.chart-header h3 {
    margin: 0;
    color: #213857;
    font-size: 0.95rem;
    font-weight: 600;
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 200px;
}

.chart-container canvas {
    max-height: 200px !important;
}

.chart-filter {
    padding: 0.3rem 0.6rem;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    background-color: #ffffff;
    color: #213857;
    font-size: 0.8rem;
    cursor: pointer;
    width: 170px;
}

.chart-toggles {
    display: flex;
    gap: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #787878;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.chart-section canvas {
    max-height: 300px;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #787878;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #d1d1d1;
    border-top: 2px solid #f7d107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 0.5rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-header h1 {
        font-size: 1.4rem;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-section {
        min-height: 250px;
    }
    
    .chart-container {
        min-height: 180px;
    }
    
    .chart-container canvas {
        max-height: 180px !important;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .map-controls {
        align-self: stretch;
    }
    
    .map-btn {
        flex: 1;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .chart-toggles {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* Override any base.css conflicting styles */
.login-container h1,
.login-container h2 {
    margin-top: 0;
}

.admin-header h1 {
    margin-top: 0;
    margin-bottom: 0;
}
