/* SleepBee Custom Styles */

/* Force light mode - disable dark mode */
:root {
    color-scheme: light only;
    --primary-color: #17047c;
    --secondary-color: #e48d13;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Override dark mode at system level */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
}

body {
    font-family: 'Fira Sans', sans-serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    font-style: normal;
    font-weight: 400;
}

/* Content Card - Rounded border card for all content */
.content-card {
    background: white;
    border-radius: 3px;
    padding: 3rem 2.5rem;
    border: 1px solid #dee2e6;
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
}

/* Ensure only one page is visible at a time */
[id$="-page"] {
    display: none !important;
}

#landing-page {
    display: flex !important;
}

/* Container adjustments for mobile */
.container,
.container-fluid {
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 576px) {
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Landing Page */
#landing-page {
    background: #ffffff;
    padding: 20px 20px;
}

#loading-page {
    background: #ffffff;
}

#landing-page .text-center {
    max-width: 600px;
    margin: 0 auto;
}

.logo-container {
    animation: fadeInDown 1s ease-in-out;
    margin-bottom: 2rem;
}

.sleepbee-logo {
    max-width: 250px;
    width: 100%;
    height: auto;
}

/* Page Logo (for white backgrounds) */
.page-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Page Logo (for colored backgrounds) */
.page-logo-white {
    max-width: 200px;
    width: 100%;
    height: auto;
}

/* SleepBee Score Logo - Card Style */
.sleepbee-score-logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 6px 16px rgba(23, 4, 124, 0.15));
    transition: all 0.3s ease;
}

.sleepbee-score-logo:hover {
    filter: drop-shadow(0 8px 20px rgba(23, 4, 124, 0.25));
    transform: translateY(-2px);
}

/* Footer Styles */
.page-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    background: transparent;
    border: none;
}

.footer-content {
    color: #666;
    background: transparent;
    border: none;
}

.footer-text {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
}

.footer-logo-left {
    height: 20px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.footer-logo-right {
    height: 20px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.app-name {
    color: var(--primary-color);
    font-weight: 700;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Accent Decorations */
#user-info-page,
#quiz-page,
#result-page {
    position: relative;
}

.main-title {
    color: var(--primary-color);
    animation: fadeInUp 1s ease-in-out;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#landing-page .lead {
    color: #6c757d;
    animation: fadeInUp 1.2s ease-in-out;
    font-size: 1.125rem;
}

#start-quiz-btn {
    background: #17047c;
    color: #fff;
    border: none;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 1.4s ease-in-out;
    padding: 1rem 2.5rem;
    border-radius: 3px;
}

#start-quiz-btn:hover {
    background: #1a0591;
    color: #fff;
}

/* Card Styles - Enhanced */
.card {
    border: 1px solid #dee2e6;
    border-radius: 3px;
    animation: fadeIn 0.5s ease-in-out;
    background: white;
}

.card-body {
    padding: 2.5rem;
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 3px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(to right, #ffffff, #f8f9fa);
}

.form-control:focus {
    border-color: #17047c;
    box-shadow: 0 0 0 0.2rem rgba(23, 4, 124, 0.25);
}

.form-control.is-valid {
    border-color: #17047c;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* jQuery Validate error label */
label.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Hide validation when valid */
.form-control.is-valid ~ .error {
    display: none;
}

/* Button Styles */
.btn {
    border-radius: 3px;
    padding: 0.75rem 2rem;
    font-weight: 400;
    font-style: normal;
    transition: all 0.3s ease;
    color: #fff;
}

.btn-primary {
    background: #17047c;
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: #1a0591;
    color: #fff;
}

.btn-outline-secondary {
    border: 1px solid #17047c;
    color: #17047c;
    background: white;
}

.btn-outline-secondary:hover {
    background: #17047c;
    color: #fff;
    border-color: #17047c;
}

/* Progress Bar */
.progress {
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    height: 10px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    background: #17047c;
    transition: width 0.5s ease;
}

.text-muted {
    color: #6c757d !important;
    font-size: 0.9rem;
}

/* Question Styles */
.question-text {
    color: #333;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.4;
}

/* Option Button Styles */
.option-btn {
    padding: 1.2rem 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    background: linear-gradient(to right, #ffffff, #f8f9fa);
    color: #333;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
    position: relative;
    font-weight: 400;
    font-style: normal;
}

.option-btn:hover {
    border-color: #17047c;
    background: white;
    color: var(--primary-color);
    transform: translateX(5px);
}

.option-btn.active {
    border-color: #17047c;
    background: #17047c;
    color: #fff;
    font-weight: 400;
    font-style: normal;
}

.option-btn.active::before {
    content: '✓';
    position: absolute;
    right: 1.2rem;
    font-size: 1.3rem;
    font-weight: bold;
}

/* Loading Page */
#loading-page {
    background: #ffffff;
}

#loading-page h2 {
    color: var(--primary-color);
    font-weight: 700;
}

#loading-page p {
    color: #6c757d;
}

.spinner-border {
    border-width: 0.3rem;
}

.spinner-border.text-light {
    color: var(--primary-color) !important;
    border-right-color: var(--secondary-color) !important;
}

/* Result Page */
#result-image-container {
    max-width: 600px;
    margin: 0 auto;
}

#result-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
}

#download-btn {
    background: #17047c;
    border: none;
    font-size: 1.2rem;
    color: #fff;
}

#download-btn:hover {
    background: #1a0591;
    color: #fff;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Responsive - Enhanced for better mobile experience */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .content-card {
        padding: 2rem 1.5rem;
        border-radius: 3px;
        width: 95%;
        max-width: 100%;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .main-title {
        font-size: 2.5rem;
        line-height: 1.3;
    }

    .lead {
        font-size: 1.125rem;
        margin-bottom: 2rem !important;
    }

    .sleepbee-logo {
        max-width: 250px;
    }

    .sleepbee-score-logo {
        max-width: 300px;
    }

    .page-logo {
        max-width: 180px;
    }

    #start-quiz-btn {
        font-size: 1.1rem;
        padding: 1rem 2.5rem;
        width: 100%;
        max-width: 400px;
    }

    .card {
        margin: 0;
    }

    .card-body {
        padding: 2rem !important;
    }

    .question-text {
        font-size: 1.5rem;
        line-height: 1.5;
    }

    .option-btn {
        padding: 1.2rem 1.5rem;
        font-size: 1.05rem;
        line-height: 1.4;
    }

    #result-image-container {
        max-width: 100%;
    }

    #result-image {
        border-width: 3px;
    }

    #download-btn {
        font-size: 1.2rem;
        padding: 0.75rem 2rem;
        width: 100%;
        max-width: 400px;
    }

    .form-label {
        font-size: 1rem;
    }

    .form-control {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .footer-logo-left {
        height: 18px;
    }

    .footer-logo-right {
        height: 18px;
    }

    /* Result Page Mobile Styles */
    #score-display-card {
        padding: 30px 20px !important;
    }

    #result-title {
        font-size: 28px !important;
        margin-bottom: 30px !important;
    }

    #score-container {
        width: 250px !important;
        height: 250px !important;
        margin: 0 auto 30px !important;
        max-width: 90vw !important;
    }

    #score-outer-ring {
        width: 100% !important;
        height: 100% !important;
        border-width: 25px !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    #score-display-circle {
        width: calc(100% - 50px) !important;
        height: calc(100% - 50px) !important;
        top: 25px !important;
        left: 25px !important;
        position: absolute !important;
    }

    #result-score-number {
        font-size: 90px !important;
        line-height: 200px !important;
    }

    #result-category {
        font-size: 26px !important;
        margin: 20px 0 15px !important;
    }

    #result-description {
        font-size: 18px !important;
        padding: 0 20px !important;
        margin-bottom: 30px !important;
    }

    #result-user-name {
        font-size: 24px !important;
    }

    #result-user-email {
        font-size: 16px !important;
    }

    #result-date {
        font-size: 14px !important;
    }

    #result-user-info {
        padding: 25px 20px !important;
        margin-top: 30px !important;
        border-radius: 15px !important;
    }
}

@media (max-width: 576px) {
    .content-card {
        padding: 2rem 1.5rem;
        border-radius: 3px;
        width: 95%;
    }

    .main-title {
        font-size: 2.5rem;
        padding: 0 10px;
    }

    .lead {
        font-size: 1.125rem;
    }

    .sleepbee-logo {
        max-width: 250px;
    }

    .sleepbee-score-logo {
        max-width: 300px;
    }

    .page-logo,
    .page-logo-white {
        max-width: 180px;
    }

    #start-quiz-btn {
        font-size: 1.1rem;
        padding: 1rem 2.5rem;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    .question-text {
        font-size: 1.4rem;
    }

    .option-btn {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        transform: translateX(0) !important;
    }

    .option-btn:hover {
        transform: translateX(0) !important;
    }

    .btn {
        font-size: 1rem;
    }

    #prev-btn,
    #next-btn,
    #submit-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .footer-logo-left {
        height: 16px;
    }

    .footer-logo-right {
        height: 16px;
    }

    .progress {
        height: 8px !important;
    }

    .spinner-border {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }

    /* Result Page Mobile Styles */
    #score-display-card {
        padding: 25px 15px !important;
    }

    #score-display-card img[alt="SleepBee"] {
        max-width: 160px !important;
    }

    #result-title {
        font-size: 24px !important;
        margin-bottom: 25px !important;
    }

    #score-container {
        width: 220px !important;
        height: auto !important;
        margin: 0 auto 25px !important;
        max-width: 80vw !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
    }

    #score-outer-ring {
        width: 100% !important;
        height: 100% !important;
        border-width: 20px !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        box-sizing: border-box !important;
    }

    #score-display-circle {
        width: calc(100% - 40px) !important;
        height: calc(100% - 40px) !important;
        top: 20px !important;
        left: 20px !important;
        position: absolute !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #result-score-number {
        font-size: 16vw !important;
        line-height: 1 !important;
        max-font-size: 70px;
    }

    @supports (font-size: clamp(1rem, 10vw, 5rem)) {
        #result-score-number {
            font-size: clamp(50px, 16vw, 70px) !important;
        }
    }

    #result-category {
        font-size: 22px !important;
        margin: 15px 0 10px !important;
    }

    #result-description {
        font-size: 16px !important;
        padding: 0 15px !important;
        margin-bottom: 25px !important;
    }

    #result-user-name {
        font-size: 20px !important;
    }

    #result-user-email {
        font-size: 14px !important;
    }

    #result-date {
        font-size: 13px !important;
    }

    .btn-lg {
        font-size: 0.95rem !important;
        padding: 0.65rem 1.5rem !important;
    }

    #result-user-info {
        padding: 20px 15px !important;
        margin-top: 25px !important;
        border-radius: 12px !important;
    }

    #result-page {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Extra small devices optimization */
@media (max-width: 375px) {
    .content-card {
        padding: 1.75rem 1.25rem;
        border-radius: 3px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .sleepbee-logo {
        max-width: 200px;
    }

    .sleepbee-score-logo {
        max-width: 260px;
    }

    .page-logo,
    .page-logo-white {
        max-width: 140px;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .option-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .footer-logo-left {
        height: 14px;
    }

    .footer-logo-right {
        height: 14px;
    }

    /* Result Page Extra Small Mobile Styles */
    #score-display-card {
        padding: 20px 12px !important;
    }

    #score-display-card img[alt="SleepBee"] {
        max-width: 140px !important;
    }

    #result-title {
        font-size: 20px !important;
        margin-bottom: 20px !important;
    }

    #score-container {
        width: 190px !important;
        height: auto !important;
        margin: 0 auto 20px !important;
        max-width: 70vw !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
    }

    #score-outer-ring {
        width: 100% !important;
        height: 100% !important;
        border-width: 18px !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        box-sizing: border-box !important;
    }

    #score-display-circle {
        width: calc(100% - 36px) !important;
        height: calc(100% - 36px) !important;
        top: 18px !important;
        left: 18px !important;
        position: absolute !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #result-score-number {
        font-size: 14vw !important;
        line-height: 1 !important;
    }

    @supports (font-size: clamp(1rem, 10vw, 5rem)) {
        #result-score-number {
            font-size: clamp(40px, 14vw, 56px) !important;
        }
    }

    #result-category {
        font-size: 19px !important;
    }

    #result-description {
        font-size: 14px !important;
        padding: 0 10px !important;
    }

    #result-user-name {
        font-size: 18px !important;
    }

    #result-user-email {
        font-size: 13px !important;
    }

    #result-date {
        font-size: 12px !important;
    }

    .btn-lg {
        font-size: 0.9rem !important;
        padding: 0.6rem 1.2rem !important;
    }

    #result-user-info {
        padding: 18px 12px !important;
        margin-top: 20px !important;
        border-radius: 10px !important;
    }
}

/* Very small mobile devices */
@media (max-width: 320px) {
    #score-display-card {
        padding: 15px 10px !important;
    }

    #score-display-card img[alt="SleepBee"] {
        max-width: 120px !important;
    }

    #result-title {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    #score-container {
        width: 170px !important;
        height: auto !important;
        margin: 0 auto 15px !important;
        max-width: 65vw !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
    }

    #score-outer-ring {
        width: 100% !important;
        height: 100% !important;
        border-width: 15px !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        box-sizing: border-box !important;
    }

    #score-display-circle {
        width: calc(100% - 30px) !important;
        height: calc(100% - 30px) !important;
        top: 15px !important;
        left: 15px !important;
        position: absolute !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #result-score-number {
        font-size: 12vw !important;
        line-height: 1 !important;
    }

    @supports (font-size: clamp(1rem, 10vw, 5rem)) {
        #result-score-number {
            font-size: clamp(35px, 12vw, 48px) !important;
        }
    }

    #result-category {
        font-size: 17px !important;
    }

    #result-description {
        font-size: 13px !important;
        padding: 0 8px !important;
    }

    #result-user-name {
        font-size: 16px !important;
    }

    #result-user-email {
        font-size: 12px !important;
    }

    #result-date {
        font-size: 11px !important;
    }

    #result-user-info {
        padding: 15px 10px !important;
        margin-top: 15px !important;
    }

    .btn-lg {
        font-size: 0.85rem !important;
        padding: 0.55rem 1rem !important;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        min-width: 48px;
    }

    .option-btn {
        min-height: 52px;
    }

    .form-control {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Utility Classes */
.shadow-lg {
    /* box-shadow removed */
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
}
