/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

.header h1 i {
    color: #667eea;
    font-size: 2.2rem;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.stat-content p {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Section Styles */
.todo-section,
.schedule-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: #667eea;
}

/* To-Do List Styles */
.todo-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.todo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.todo-input:focus {
    outline: none;
    border-color: #667eea;
}

.todo-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-family: inherit;
}

.filter-btn.active,
.filter-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.todo-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.todo-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.todo-item.completed {
    opacity: 0.7;
    border-left-color: #48bb78;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #718096;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.todo-checkbox:checked {
    background: #48bb78;
    border-color: #48bb78;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
}

.todo-actions {
    display: flex;
    gap: 8px;
}

.todo-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
    color: #718096;
}

.todo-actions button:hover {
    background: #e2e8f0;
    color: #2d3748;
}

/* Schedule Styles */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-date {
    font-weight: 600;
    color: #2d3748;
    min-width: 120px;
    text-align: center;
}

/* Schedule Layout: container sizes are dynamically set via JS for 8h window */
.schedule-container { position: relative; }
.time-slots { position: absolute; left: 0; top: 0; width: 80px; z-index: 1; }
.events-container { margin-left: 80px; position: relative; border-left: 1px solid #e2e8f0; overflow: hidden; }

.time-slot {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
}

.time-slot.current-hour {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 600;
}

.event-item {
    position: absolute;
    left: 8px;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.event-item:hover {
    transform: scale(1.02);
}

.event-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.event-time {
    font-size: 11px;
    opacity: 0.9;
}

/* Current Time Indicator */
.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.current-time-line {
    height: 3px; /* thicker */
    background: #ff3b30; /* brighter red */
    width: 100%;
    box-shadow: 0 0 6px rgba(255, 59, 48, 0.6);
}

.current-time-label {
    position: absolute;
    right: 8px;
    top: -14px;
    background: #ff3b30;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-header h1 i {
    color: #667eea;
}

.login-header p {
    color: #718096;
    font-size: 1rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.login-footer {
    margin-top: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #4a5568;
}

.login-footer p {
    margin: 5px 0;
}

.login-footer code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Welcome text styling */
.welcome-text {
    color: #4a5568;
    font-weight: 500;
    margin-right: 15px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #2d3748;
}

/* Form Styles */
form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .todo-section,
    .schedule-section {
        padding: 20px;
    }
    
    .schedule-container {
        min-height: 300px;
    }
    
    .time-slots {
        width: 60px;
    }
    
    .time-slot {
        height: 50px;
        font-size: 11px;
    }
    
    .events-container {
        margin-left: 60px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Scrollbar Styling */
.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Priority Indicators */
.priority-high {
    border-left-color: #e53e3e !important;
}

.priority-medium {
    border-left-color: #d69e2e !important;
}

.priority-low {
    border-left-color: #38a169 !important;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: #4a5568;
}

.empty-state p {
    font-size: 14px;
}

/* Environment Card Emphasis */
#envCard {
    grid-column: span 2;
}
#envCard .stat-icon {
    width: 72px;
    height: 72px;
    font-size: 28px;
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
}
#envCard .stat-content h3 {
    font-size: 2.5rem;
}
#envCard .stat-content p {
    font-size: 1rem;
}

@media (max-width: 768px) {
    #envCard {
        grid-column: span 1;
    }
    #envCard .stat-content h3 {
        font-size: 2rem;
    }
}
