/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.1em;
    color: #7f8c8d;
}

.active-session-display {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 8px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.active-session-display.hidden {
    display: none;
}

.active-session-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.active-session-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.active-session-start {
    font-size: 1.2em;
    font-weight: 600;
}

.active-session-timer {
    text-align: right;
}

.active-session-elapsed {
    font-size: 2em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.tabs {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #bdc3c7;
}

.tab-button.active {
    background: #3498db;
    color: white;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Session Log View */
.session-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

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

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #219a52;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #27ae60;
}

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

.btn-outline:hover:not(:disabled) {
    background: #3498db;
    color: white;
}

.session-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.session-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

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

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

.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

.csv-import-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.csv-import-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

.csv-import-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

.import-status {
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 500;
}

.import-status.hidden {
    display: none;
}

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

.import-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.import-status.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.import-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.import-summary.hidden {
    display: none;
}

.import-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.import-summary-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.import-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.import-summary-item .label {
    font-weight: 500;
    color: #495057;
}

.import-summary-item .value {
    font-weight: 600;
    color: #2c3e50;
}

.import-summary-item.success .value {
    color: #28a745;
}

.import-summary-item.warning .value {
    color: #ffc107;
}

.import-summary-item.error .value {
    color: #dc3545;
}

.import-errors {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.import-error {
    padding: 5px 0;
    font-size: 0.9em;
    color: #721c24;
    border-bottom: 1px solid #f8f9fa;
}

.import-error:last-child {
    border-bottom: none;
}

.sessions-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sessions-list h2 {
    margin: 0;
    padding: 20px;
    background: #ecf0f1;
    color: #2c3e50;
}

#sessions-container {
    padding: 20px;
}

/* Session item styles */
.session-item {
    border-bottom: 1px solid #ecf0f1;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

.session-info {
    flex: 1;
    min-width: 200px;
}

.session-info h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.session-details {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.session-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.session-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Summary View */
.summary-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.summary-controls label {
    font-weight: 600;
}

.summary-controls select,
.summary-controls input[type="date"] {
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

#custom-date-range.hidden {
    display: none;
}

.summary-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

#summary-loading {
    padding: 40px;
    text-align: center;
    color: #7f8c8d;
}

.summary-data {
    padding: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.summary-card .value {
    font-size: 2em;
    font-weight: bold;
    color: #27ae60;
}

.summary-card .label {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .session-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .session-controls .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .session-info {
        min-width: 100%;
    }
    
    .session-details {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summary-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .summary-controls label {
        margin-bottom: 5px;
    }
    
    .summary-controls select,
    .summary-controls input[type="date"] {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 0;
    }
    
    .tab-button:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .tab-button:last-child {
        border-radius: 0 0 8px 8px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form validation styles */
input:invalid {
    border-color: #e74c3c;
}

input:focus:invalid {
    box-shadow: 0 0 0 2px rgba(231,76,60,0.2);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-btn:hover {
    color: #2c3e50;
}

#password-change-form {
    padding: 20px;
}

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

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
}

.success-message {
    color: #28a745;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #d4edda;
    border-radius: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}