/* DPS Data Analysis - Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.btn-secondary:disabled {
    background-color: #cbd5e1;
    border-color: #94a3b8;
    color: #64748b;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: var(--danger-color);
    font-size: 14px;
    padding: 12px;
    background-color: #fee2e2;
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dashboard Page */
.navbar {
    background: white;
    padding: 16px 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand h1 {
    font-size: 20px;
    color: var(--text-primary);
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

.site-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    padding: 8px 16px;
    border-radius: 8px;
}

.site-selector label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.site-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 250px;
    transition: border-color 0.2s;
}

.site-dropdown:hover {
    border-color: var(--primary-color);
}

.site-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.site-info {
    font-size: 13px;
    color: var(--text-secondary);
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.dashboard-container {
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    width: 100%;
}

.dashboard-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.empty-message {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 40px;
}

.jobs-list, .reports-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Analysis Form - Horizontal Layout */
.analysis-form {
    width: 100%;
}

.analysis-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.analysis-section {
    background: white;
    padding: 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.analysis-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--background);
}

/* Section Selection (Left) - Auto expand to fill space */
.section-selection {
    flex: 1;
    min-width: 400px;
}

/* Date Selection (Middle) */
.date-selection {
    flex: 0 0 auto;
    width: 520px;
}

/* Sampling Interval Selection */
.sampling-selection {
    flex: 0 0 auto;
    width: 180px;
}

.sampling-input-small {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 500;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.sampling-input-small:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.sampling-input-small::placeholder {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.sampling-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-sampling {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-sampling:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.btn-sampling.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Action Button (Right) */
.action-button {
    flex: 0 0 auto;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.btn-execute {
    width: 100%;
    height: 100%;
    min-height: 180px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s;
}

.btn-execute:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

.data-range-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1e40af;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.data-range-info strong {
    color: #1e3a8a;
    font-weight: 600;
}

.date-inputs {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-end;
}

.date-inputs .form-group {
    flex: 1;
}

.datetime-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

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

.date-shortcuts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-shortcut {
    padding: 7px 14px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-shortcut:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

/* Section Selection Cards */
.sections-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.section-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-group-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
    width: 100%;
}

.section-card {
    position: relative;
    padding: 8px 6px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.section-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15);
}

.section-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.section-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.section-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.section-card.selected .section-card-title {
    color: var(--primary-color);
}

.section-card-details {
    font-size: 9px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.section-card.selected .section-card-details {
    color: #1e40af;
}

/* Chart Container */
#chartContainer {
    width: 100%;
    min-height: 500px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#loadingIndicator {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 8px;
    border: 2px solid #93c5fd;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .analysis-layout {
        flex-wrap: wrap;
    }

    .section-selection {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .date-selection {
        flex: 1 1 calc(50% - 10px);
    }

    .sampling-selection {
        flex: 1 1 calc(30% - 10px);
    }

    .action-button {
        flex: 1 1 calc(20% - 10px);
    }
}

@media (max-width: 768px) {
    .analysis-layout {
        flex-direction: column;
    }

    .section-selection,
    .date-selection,
    .sampling-selection,
    .action-button {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .btn-execute {
        min-height: 60px;
    }

    .section-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .date-inputs {
        flex-direction: column;
    }

    .date-shortcuts {
        flex-wrap: wrap;
    }

    .sampling-shortcuts {
        flex-direction: row;
    }
}

/* Report Progress Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.progress-container {
    margin-bottom: 32px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4f46e5);
    transition: width 0.5s ease-out;
    border-radius: 6px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.step.active {
    background: #eff6ff;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.step.completed {
    background: #f0fdf4;
    border-color: var(--success-color);
}

.step-icon {
    font-size: 28px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active .step-icon {
    opacity: 1;
    animation: bounce 1s infinite;
}

.step.completed .step-icon {
    opacity: 1;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--success-color);
}
/* Chart Clickable */
#chartContainer,
#postDisplacementChart {
    cursor: pointer;
}

/* Chart Expand Modal */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(2px);
}

.chart-modal-content {
    background: white;
    border-radius: 12px;
    width: 95vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.chart-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-modal-download {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-download:hover {
    background: var(--primary-hover);
}

.chart-modal-close {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.chart-modal-close:hover {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.chart-modal-plot {
    flex: 1;
    min-height: 0;
}

/* Force cache refresh - 1771149685 */
