/* app/static/app.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover, nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.error {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.login-note {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    font-size: 14px;
}

.login-note p {
    margin: 5px 0;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-filter, .btn-clear {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-filter {
    background-color: #28a745;
    color: white;
}

.btn-clear {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover, .btn-filter:hover, .btn-clear:hover {
    opacity: 0.9;
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Summary */
.summary {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th.sortable a {
    color: #333;
    text-decoration: none;
    display: block;
}

.data-table th.sortable a:hover {
    color: #667eea;
}

.data-table td.number {
    text-align: right;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.data-table td.symbol {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-pass {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-warn {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.status-fail {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.status-unknown {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Row status colors */
.data-table tr.status-pass {
    background-color: rgba(212, 237, 218, 0.3);
}

.data-table tr.status-warn {
    background-color: rgba(255, 243, 205, 0.3);
}

.data-table tr.status-fail {
    background-color: rgba(248, 215, 218, 0.3);
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px !important;
}

/* Configuration Form */
.config-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 600;
    color: #667eea;
    padding: 0 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.items-per-page select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-page {
    padding: 8px 15px;
    background-color: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-page:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.current-page {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
}

/* Sortable Column Headers */
.data-table th a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: block;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s;
}

.data-table th a:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-page, .current-page {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Time Period Selector */
.time-period-selector {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.time-periods {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-periods label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.period-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    color: #555;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: normal;
    height: 44px;
}

.period-btn:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.period-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.period-btn.disabled {
    background: #f5f5f5;
    border-color: #ddd;
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.period-btn.disabled:hover {
    background: #f5f5f5;
    border-color: #ddd;
    color: #bbb;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .time-periods {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .period-tabs {
        justify-content: center;
    }
    
    .period-btn {
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
}
