/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 100%;
    padding: 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 600px;
    }
}

/* Logo */
.logo-container {
    text-align: center;
    padding: 40px 0 30px;
}

.logo-text {
    font-size: 3rem;
    font-weight: bold;
    color: #4688AE;
    letter-spacing: 8px;
}

.logo-subtext {
    font-size: 1.1rem;
    color: #666;
    letter-spacing: 4px;
    margin-top: -5px;
}

.version-text {
    font-size: 0.9rem;
    color: #999;
    margin-top: 10px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #4688AE;
    box-shadow: 0 0 0 3px rgba(70, 136, 174, 0.15);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-input:disabled,
.form-select:disabled {
    background-color: #eee;
    color: #999;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #4688AE;
    color: #fff;
}

.btn-primary:hover {
    background-color: #3a7799;
}

.btn-primary:disabled {
    background-color: #A5A5A6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #74B2D7;
    color: #fff;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #4688AE;
    color: #4688AE;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.header-subtitle {
    font-size: 0.8rem;
    color: #666;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Quick Range Buttons */
.quick-range-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-range-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    background-color: #74B2D7;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.quick-range-btn:active {
    background-color: #4688AE;
}

/* Date inputs */
.date-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fdeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4688AE;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: #666;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 8px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
}

.report-table th {
    background-color: #4688AE;
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.report-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.report-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.report-table tr:hover {
    background-color: #f0f7fb;
}

/* Info Bar */
.info-bar {
    background-color: #e8f4f8;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #666;
}

/* Bottom Actions */
.bottom-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
}

.bottom-actions .btn {
    flex: 1;
}

/* Filter Group Disabled State */
.filter-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 16px;
}

.hidden {
    display: none !important;
}

/* Page specific */
.filters-page {
    padding-bottom: 100px;
}

.report-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.report-content {
    flex: 1;
    overflow: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .logo-text {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    .btn {
        padding: 12px 20px;
    }

    .form-input,
    .form-select {
        padding: 12px 14px;
    }
}
