/* styles.css */

/* -----------------------------------
   1. Global Styles
----------------------------------- */

/* Import Fonts (Ensure these are loaded in your HTML or via @import) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&family=Roboto:wght@500&display=swap');

/* Body Styling */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f1f3f5;
    margin: 0;
    padding: 0;
}

/* -----------------------------------
   2. Container and Layout
----------------------------------- */

/* Centering the Container */
.container#game {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertical centering */
    align-items: center;     /* Horizontal centering */
    min-height: 100vh;       /* Full viewport height */
    padding: 20px;           /* Padding for spacing */
    box-sizing: border-box;  /* Include padding in width */
    background-color: #ffffff;
    border-radius: 25px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;        /* Combined max-width */
    margin: 2rem auto;       /* Center horizontally with top/bottom margin */
}

/* Adjusting the Game Wrapper */
.game-wrapper {
    width: 100%;
    max-width: 800px;        /* Limit maximum width */
    text-align: center;      /* Center text */
}

/* -----------------------------------
   3. Heading and Subheading
----------------------------------- */

/* Main Heading */
.game-wrapper h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    color: #343a40;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Subheading */
.game-wrapper .subheading {
    text-align: center;
    margin-bottom: 30px;
    color: #6c757d;
    font-size: 1.2em;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

/* -----------------------------------
   4. Question Styling
----------------------------------- */

/* Question Text */
#question {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

/* -----------------------------------
   5. Choice Container Styling
----------------------------------- */

/* General choice container styling */
.choice-container {
    display: flex;
    justify-content: center; /* Center content horizontally */
    align-items: center;     /* Center content vertically */
    margin-bottom: 2rem;     /* Increased margin for better spacing */
    font-size: 1.8rem;
    border: 2px solid #dee2e6; /* Standard border */
    background-color: #ffffff; /* White background */
    color: #212529;            /* Dark text color */
    border-radius: 10px;       /* Smaller radius for a sleek look */
    text-align: center;
    padding: 20px;             /* Adequate padding */
    width: 100%;
    transition: background-color 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;           /* Pointer cursor for interactivity */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

/* Hover Effects */
.choice-container:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.2); /* Stronger shadow for feedback */
}

/* Active/Focus Effects for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .choice-container:active,
    .choice-container:focus {
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
        transform: translateY(-0.1rem);
        background-color: rgba(15, 117, 189, 0.85);
        border-color: #0f75bd;
    }
}

/* Choice Text Styling */
.choice-text {
    width: 100%;
    font-size: 1.8rem;         /* Slightly reduced for mobile */
    text-align: center;        /* Center text horizontally */
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    margin: 0;
    color: #212529;
}

/* Correct and Incorrect Answer Styles */
.correct {
    background-color: rgba(40, 167, 69, 0.7); /* Soft green for correct answer */
    color: white;
}

.incorrect {
    background-color: rgba(220, 53, 69, 0.7); /* Soft red for incorrect answer */
    color: white;
}

/* -----------------------------------
   6. Progress Bar Styling
----------------------------------- */

/* Progress Bar Container */
#progress-bar {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    height: 25px;
    margin-top: 30px;
}

/* Progress Bar Fill */
#progressBarFull {
    height: 100%;
    width: 0%;
    background-color: #28a745;
    transition: width 0.4s ease;
    border-radius: 10px;
}

/* Progress Text Styling */
#progressText {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #495057;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
}

/* -----------------------------------
   7. Personality Types Buttons
----------------------------------- */

/* Button Styling */
.btn-personality {
    display: inline-block;
    padding: 12px 24px;
    margin: 5px;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
    background-color: #ffffff; /* Initial background set to white */
    color: #343a40;            /* Initial text color set to a dark shade for contrast */
    border: 2px solid transparent; /* Default border */
    cursor: pointer;           /* Pointer cursor on hover */
    outline: none;             /* Remove default outline */
    font-size: 1.2em;
    font-family: 'Roboto', sans-serif;
}

/* Remove default focus styles */
.btn-personality:focus {
    outline: none;
    box-shadow: none;
}

/* Border Styles */
.btn-personality.btn-border-blue {
    border-color: #f72c93; /* Pink border for blue button */
}

.btn-personality.btn-border-pink {
    border-color: #0F75BD; /* Blue border for pink button */
}

/* Hover and Active States */
.btn-personality.btn-border-blue:hover,
.btn-personality.btn-border-blue:active {
    transform: scale(1.05);
    background-color: #0F75BD; /* On hover or active, button turns blue */
    color: #ffffff;            /* Text color becomes white on hover for contrast */
    border-color: #0F75BD;     /* Maintain border color */
}

.btn-personality.btn-border-pink:hover,
.btn-personality.btn-border-pink:active {
    transform: scale(1.05);
    background-color: #f72c93; /* On hover or active, button turns pink */
    color: #ffffff;            /* Text color becomes white on hover for contrast */
    border-color: #f72c93;     /* Maintain border color */
}

/* Large Buttons */
.btn-large {
    font-size: 1.5em;         /* Larger font size */
    padding: 20px 40px;       /* Increase padding for larger button */
}

.btn-personality.btn-large.btn-border-pink:hover,
.btn-personality.btn-large.btn-border-pink:active {
    transform: scale(1.05);
    background-color: #f72c93; /* On hover or active, button turns pink */
    color: #ffffff;            /* Text color becomes white on hover for contrast */
    border-color: #f72c93;     /* Maintain border color */
}

/* Final Score Button */
#finalScore.btn-border-gray {
    border-color: #cccccc; /* Gray border for unexpected results */
}

/* Ensure buttons are not preselected on mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-personality:active {
        transform: none;
        background-color: #ffffff; /* Maintain white background on active */
        color: #343a40;            /* Maintain dark text color */
        border-color: inherit;     /* Use inherited border color */
    }
}

/* -----------------------------------
   8. Matchmaking Apps Styling
----------------------------------- */

/* Matchmaking Apps Container */
.app-option {
    display: inline-block;
    margin: 15px;
    text-align: center;
}

/* App Logo Styling */
.app-logo {
    width: 180px;                /* Explicit width */
    height: 180px;               /* Explicit height */
    object-fit: cover;           /* Maintains image aspect ratio */
    border-radius: 15%;
    box-shadow: 1px 4px 8px rgba(0, 0, 0, 0.3); /* Subtle shadow */
    cursor: pointer;
    transition: 0.3s;
}

.app-logo:hover {
    opacity: 0.7;
}

/* App Link and Store Buttons */
.app-link,
.store-buttons a {
    display: block;
    margin-top: 10px;
}

/* App Description */
.app-description {
    margin: 10px 0;
    color: #555;
    font-size: 0.9em;
    font-family: 'Roboto', sans-serif;
}

/* Button for Matchmaking Apps */
.app-link-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    border: 2px solid #0F75BD;
    border-radius: 25px;
    color: #0F75BD;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.app-link-btn:hover {
    background-color: #0F75BD;
    color: #ffffff;
}

/* -----------------------------------
   9. Description Sections
----------------------------------- */

/* Description Sections */
.description {
    display: none; /* Hidden by default */
    margin-top: 20px;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    font-family: 'Roboto', sans-serif;
}

.active-description {
    display: block;
    opacity: 1;
}

/* Description Header */
.description-header {
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 10px;
    color: #333;
    text-decoration: underline;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.description-content {
    font-size: 1.1em;
    line-height: 1.6em;
    color: #555;
    margin: 10px 0;
    text-align: justify;
    font-family: 'Roboto', sans-serif;
}

/* Preamble Sections */
.preamble {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.preamble span {
    color: #0F75BD; /* Highlight for dynamic elements */
}

/* Temperament Section */
.temperament-section {
    margin-top: 20px;
    padding: 15px;
    border-left: 4px solid #f72c93; /* Accent border for emphasis */
    background-color: #f9f9f9;        /* Subtle background */
}

.temperament-section .description-header {
    color: #f72c93;
}

/* Hover and Emphasis Styling for Description Headers */
.description-header:hover {
    color: #0F75BD;
    cursor: pointer;
}

/* -----------------------------------
   10. Responsive Design Enhancements
----------------------------------- */

/* Responsive Adjustments for Smaller Screens */
@media (max-width: 768px) {
    /* Adjust Game Container */
    .container#game {
        padding: 15px;      /* Reduced padding */
        margin: 30px 15px;  /* Adjust margins */
    }

    /* Adjust Heading Sizes */
    .game-wrapper h1 {
        font-size: 2em;
    }

    .game-wrapper .subheading {
        font-size: 1em;
    }

    /* Adjust Question Size */
    #question {
        font-size: 1.3em;
    }

    /* Adjust Choice Container */
    .choice-container {
        padding: 15px;
        margin-bottom: 10px;
        font-size: 1.1em;
    }

    /* Adjust Choice Text */
    .choice-text {
        font-size: 1.1em;
    }

    /* Adjust Progress Bar */
    #progress-bar {
        height: 20px;
    }

    /* Adjust Progress Text */
    #progressText {
        font-size: 1em;
    }

    /* Adjust App Logo Size */
    .app-logo {
        width: 150px;
        height: 150px;
    }

    /* Adjust Button Sizes */
    .btn-personality {
        font-size: 1em;
        padding: 10px 20px;
    }

    .btn-large {
        font-size: 1.2em;
        padding: 15px 30px;
    }

    /* Stack Choices Vertically */
    .row .col-md-6 {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Adjust Choice Container Width */
    .choice-container {
        width: 100%;
    }
}

/* Responsive Adjustments for Larger Screens */
@media (min-width: 769px) {
    /* Increase Game Container Padding */
    .container#game {
        padding: 3rem;
    }

    /* Adjust Choice Container Width and Margin */
    .choice-container {
        width: 80%;
        margin: 1rem auto; /* Center buttons and give more breathing room on desktop */
    }
}

/* -----------------------------------
   11. Accessibility Enhancements
----------------------------------- */

/* Adding focus states for accessibility */
.choice-container:focus {
    outline: none;
    border-color: #28a745;
    background-color: #d4edda;
}

/* Button-like cursor on choice hover */
.choice-container {
    cursor: pointer;
}
