/* Sleep Tab Styles - Add to styles.css */

/* Sleep Status Card */
.sleep-status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sleep-status-card .status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sleep-status-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sleep-status-card .status-time {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Active Sleep Session Card */
.sleep-session-card {
    background: linear-gradient(135deg, #4c63d2 0%, #5a67d8 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #667eea;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: #667eea;
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        border-color: #4c63d2;
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.session-timer {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.session-actions {
    display: flex;
    justify-content: center;
}

/* Sleep Controls */
.sleep-controls {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.control-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.control-section h3 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 1.1rem;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-sleep-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .quick-sleep-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .control-buttons {
        grid-template-columns: 1fr;
    }
}

/* Button Styles - Fix missing styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.quick-sleep-duration {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.quick-sleep-duration:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Sleep Analysis Section */
.sleep-analysis-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.analysis-results {
    margin-top: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.analysis-content {
    display: grid;
    gap: 20px;
}

.insights-section,
.patterns-section,
.correlations-section,
.predictions-section {
    padding: 15px;
    border-radius: 8px;
    background: white;
    border-left: 4px solid #667eea;
}

.insight {
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.insight.positive {
    background: #f0fff4;
    border-left: 3px solid #38a169;
    color: #22543d;
}

.insight.warning {
    background: #fffbf0;
    border-left: 3px solid #ed8936;
    color: #744210;
}

.insight.tip {
    background: #ebf8ff;
    border-left: 3px solid #4299e1;
    color: #2a4365;
}

.insight.info {
    background: #f7fafc;
    border-left: 3px solid #718096;
    color: #4a5568;
}

/* Sleep Statistics Grid */
.sleep-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recent Sleep Activities */
.recent-activities {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activities h3 {
    margin: 0 0 20px 0;
    color: #4a5568;
}

.sleep-item {
    border-left: 4px solid #667eea;
}

.sleep-item .activity-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.activity-meta {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 5px;
}

.activity-notes {
    font-size: 0.85rem;
    color: #4a5568;
    font-style: italic;
    margin-top: 8px;
    padding: 8px;
    background: #f7fafc;
    border-radius: 4px;
}

/* Sleep Modal Enhancements */
#sleep-modal .modal-content {
    max-width: 500px;
}

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

#sleep-modal select,
#sleep-modal input,
#sleep-modal textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#sleep-modal select:focus,
#sleep-modal input:focus,
#sleep-modal textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sleep-modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

/* Sleep Analysis Modal */
#sleep-analysis-modal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Navigation updates for 5 tabs */
.bottom-nav {
    display: grid;
    /*grid-template-columns: repeat(4, 1fr);*/
    grid-template-columns: repeat(5, 1fr);
}

.nav-item {
    min-width: auto;
    flex: 1;
}

@media (max-width: 480px) {
    .nav-label {
        font-size: 0.7rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
}

/* Responsive adjustments for sleep tab */
@media (max-width: 768px) {
    .sleep-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analysis-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analysis-actions {
        justify-content: center;
    }
    
    .sleep-session-card .session-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .session-timer {
        font-size: 1.5rem;
    }
}

/* Sleep quality indicators */
.quality-excellent { color: #38a169; }
.quality-good { color: #4299e1; }
.quality-fair { color: #ed8936; }
.quality-poor { color: #e53e3e; }
.quality-terrible { color: #9f1239; }

/* Animation for sleep tracking */
.sleep-tracking-animation {
    animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Activity List Items */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s ease;
}

.activity-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-icon {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
    background: var(--primary);
    color: white;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--error);
}

/* No data placeholder */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
}

