/* Advanced Sleep Calculator Specific Styles */

/* Loading and Toast Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

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

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

/* Animation Effects */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(133, 193, 233, 0.05) 100%);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Profile Section */
.profile-section {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: #fffef7;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.2);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.section-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Form Styles */
.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #3498db;
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    background: #3498db;
    border-color: #3498db;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #000000;
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ span {
    font-weight: 600;
}

/* Select Styles */
.form-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fffef7;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.form-select option {
    background: #1a1a1a;
    color: #fffef7;
}

/* Season Grid */
.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.season-option {
    cursor: pointer;
}

.season-option input[type="radio"] {
    display: none;
}

.season-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.season-card:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-3px);
}

.season-option input[type="radio"]:checked + .season-card {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.season-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.season-card span {
    font-weight: 600;
    font-size: 1rem;
}

/* Time Input */
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fffef7;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #9d4edd;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.6);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.1);
}

.result-card h3 {
    color: #9d4edd;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Schedule Info */
.schedule-info {
    text-align: center;
}

.time-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.time-label {
    font-weight: 600;
    color: #f5f5dc;
}

.time-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9d4edd;
}

/* Insights Content */
.insights-content {
    line-height: 1.6;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #f0e68c;
}

.insight-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    color: #9d4edd;
}

.insight-text {
    flex: 1;
    color: #f5f5dc;
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
}

.recommendations-section h3 {
    color: #9d4edd;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

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

.article-card {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 3px 15px rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.4);
    text-decoration: none;
    color: inherit;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #9d4edd;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-description {
    color: #f5f5dc;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
}

.article-category {
    background: linear-gradient(135deg, #f0e68c 0%, #daa520 100%);
    color: #000000;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-readtime {
    color: #f5f5dc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-section {
        padding: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .season-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .time-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-section {
        padding: 1rem;
    }
    
    .season-grid {
        grid-template-columns: 1fr;
    }
    
    .season-card {
        padding: 1rem;
    }
    
    .calculate-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

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

/* Success Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}