/* Sleep Tracker Specific Styles */

.sleep-section {
    padding: 4rem 0;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.summary-card {
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.summary-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.sleep-quality {
    margin-top: 1rem;
}

.quality-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quality-badge.poor {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.quality-badge.fair {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.quality-badge.good {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.quality-badge.excellent {
    background: rgba(48, 209, 88, 0.2);
    color: #30d158;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.summary-target {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.score-ring {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.score-ring svg {
    transform: scale(0.8);
}

.streak-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Tracker Grid */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tracker-card {
    padding: 2rem;
}

.card-header {
    margin-bottom: 2rem;
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Sleep Form */
.sleep-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.duration-display {
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    text-align: center;
}

.duration-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.duration-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Quality Selector */
.quality-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quality-btn {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.quality-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.quality-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.quality-emoji {
    font-size: 2rem;
}

.quality-btn span:last-child {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Disruption Options */
.disruption-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked+span {
    color: var(--primary-color);
}

/* Sleep List */
.sleep-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sleep-list::-webkit-scrollbar {
    width: 6px;
}

.sleep-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sleep-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sleep-item {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sleep-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.sleep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sleep-date {
    font-weight: 600;
    font-size: 1.1rem;
}

.sleep-duration {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sleep-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sleep-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sleep-detail strong {
    color: var(--text-primary);
}

.sleep-disruptions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.disruption-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
    border-radius: 12px;
    font-size: 0.8rem;
}

.sleep-notes {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sleep-delete {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

.sleep-delete:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.5);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.empty-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Weekly Chart */
.chart-section {
    padding: 2rem;
    margin-bottom: 3rem;
}

.weekly-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 300px;
    gap: 1rem;
    padding: 2rem 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Target line at 7 hours */
.weekly-chart::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - (7/12 * 100%));
    height: 2px;
    background: rgba(52, 199, 89, 0.3);
    border-top: 2px dashed rgba(52, 199, 89, 0.5);
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar {
    width: 60%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
    transition: all 0.5s ease;
    position: relative;
    min-height: 5px;
}

.bar.good-sleep {
    background: linear-gradient(180deg, #34c759 0%, #30d158 100%);
}

.bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.bar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tips Section */
.tips-section {
    margin-top: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tip-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tip-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .tracker-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .quality-selector {
        grid-template-columns: 1fr;
    }

    .disruption-options {
        grid-template-columns: 1fr;
    }

    .weekly-chart {
        height: 250px;
        padding: 1rem 0.5rem;
    }

    .bar-label {
        font-size: 0.75rem;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 2rem;
    }

    .sleep-details {
        grid-template-columns: 1fr;
    }
}