/* styles.css */
/* Sleep Cycle Calculator - Hybrid of sleepcycle.com style with sleepytime.cc functionality */
/* Base Styles and Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #FFFFFF;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Elements */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        #1a0b3d 0%,          /* Deep purple at top */
        #2d1b69 25%,         /* Rich purple */
        #4c3d8a 50%,         /* Purple-blue */
        #5b4b9a 75%,         /* Lighter purple-blue */
        #6b5b9f 100%         /* Blue-purple at bottom */
    );
    z-index: -3;
}

/* Animated Stars */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: starBlink infinite ease-in-out;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes starBlink {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Animated Moon */
.moon-container {
    position: absolute;
    top: 15%;
    left: -10%;
    width: 120px;
    height: 120px;
    z-index: -1;
    animation: moonTravel 60s linear infinite;
}

.moon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

@keyframes moonTravel {
    0% {
        left: -10%;
        transform: translateY(0px);
    }

    25% {
        left: 25%;
        transform: translateY(-20px);
    }

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

    75% {
        left: 75%;
        transform: translateY(-30px);
    }

    100% {
        left: 110%;
        transform: translateY(0px);
    }
}

/* Smoke-like clouds */
.clouds-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: -1;
    overflow: hidden;
}

.cloud {
    position: absolute;
    bottom: -50px;
    width: 200px;
    height: 100px;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 70%);
    border-radius: 50px;
    animation: cloudFloat infinite linear;
    filter: blur(2px);
}

.cloud::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(1px);
}

.cloud::after {
    content: '';
    position: absolute;
    top: -20px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(1.5px);
}

@keyframes cloudFloat {
    0% {
        transform: translateX(-220px) translateY(0px);
    }

    50% {
        transform: translateX(50vw) translateY(-20px);
    }

    100% {
        transform: translateX(calc(100vw + 220px)) translateY(0px);
    }
}

/* Layout */
header,
main,
footer {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    padding-top: 30px;
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-left: 10px;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

main {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Initial View */
#initial-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.wake-up-section,
.bedtime-section,
.sleep-now-section {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 500;
    color: #FFFACD;
}

.time-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.time-input {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(10, 10, 35, 0.7);
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

select {
    background-color: transparent;
    border: none;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    padding: 5px;
    margin: 0 5px;
    appearance: none;
    text-align: center;
    cursor: pointer;
}

select:focus {
    outline: none;
}

.time-separator {
    font-size: 1.5rem;
    margin: 0 5px;
}

.calculate-btn,
.sleep-now-btn,
.back-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.calculate-btn:hover,
.sleep-now-btn:hover,
.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-icon {
    font-size: 1.0rem;
}

.sleep-now-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
}

.divider {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
}

.divider span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 0 10px;
}

/* Results View */
#results-view {
    text-align: center;
}

#results-view.hidden {
    display: none;
}

#results-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #FFFACD;
}

.time-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.time-suggestion {
    background-color: rgba(10, 10, 35, 0.7);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.time {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.cycles {
    font-size: 1rem;
    margin-bottom: 5px;
}

.duration {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.quality-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.quality-optimal {
    background-color: #4CAF50;
}

.quality-acceptable {
    background-color: #FFC107;
}

.quality-suboptimal {
    background-color: #F44336;
}

.how-it-works {
    background-color: rgba(10, 10, 35, 0.7);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.how-it-works h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}

.how-it-works ul {
    list-style-position: inside;
    padding-left: 10px;
}

.how-it-works li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.back-btn {
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    select {
        font-size: 1.3rem;
    }

    .time-suggestions {
        grid-template-columns: 1fr;
    }

    .moon {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    select {
        font-size: 1.1rem;
    }

    .calculate-btn,
    .sleep-now-btn,
    .back-btn {
        font-size: 0.9rem;
    }

    .time {
        font-size: 1.5rem;
    }

    .moon {
        width: 40px;
        height: 40px;
        top: 10%;
        right: 10%;
    }
}

/* Feedback Button Styles */
.feedback-link {
    text-align: center;
    margin-bottom: 20px;
}

.feedback-btn {
    background-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 10px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.feedback-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Feedback Modal Styles */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-modal.show {
    opacity: 1;
    visibility: visible;
}

.feedback-content {
    background-color: rgba(10, 10, 35, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.feedback-header {
    text-align: center;
    margin-bottom: 25px;
}

.feedback-header h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #FFFACD;
}

.feedback-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #FFFACD;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.feedback-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.submit-feedback-btn,
.close-feedback-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-feedback-btn {
    background-color: rgba(76, 175, 80, 0.8);
    color: white;
}

.submit-feedback-btn:hover {
    background-color: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
}

.close-feedback-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.close-feedback-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.feedback-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.feedback-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.feedback-footer a:hover {
    color: #FFFACD;
}

/* Mobile responsiveness for feedback modal */
@media (max-width: 768px) {
    .feedback-content {
        padding: 20px;
        margin: 20px;
    }

    .feedback-header h3 {
        font-size: 1.3rem;
    }

    .feedback-actions {
        flex-direction: column;
    }

    .submit-feedback-btn,
    .close-feedback-btn {
        width: 100%;
    }
}

