/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 30px;
    position: relative;
}

header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #bdc3c7;
}

.exit-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.exit-button:hover {
    background-color: #c0392b;
}

/* Screen Management */
.screen {
    display: none;
    padding: 30px;
    min-height: 400px;
}

.screen.active {
    display: block;
}

/* Typography */
h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 26px;
}

h3 {
    color: #34495e;
    margin-bottom: 15px;
    margin-top: 25px;
    font-size: 20px;
}

p {
    margin-bottom: 15px;
}

/* Info Boxes */
.info-box {
    background-color: #ecf0f1;
    border-left: 4px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box.warning {
    background-color: #fef5e7;
    border-left-color: #f39c12;
}

.info-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Consent Checkbox */
.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.consent-checkbox span {
    flex: 1;
    line-height: 1.5;
}

/* Buttons */
button {
    font-family: inherit;
    font-size: 16px;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-button {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

.primary-button:hover:not(:disabled) {
    background-color: #2980b9;
}

.primary-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.secondary-button {
    background-color: #95a5a6;
    color: white;
    font-weight: 600;
}

.secondary-button:hover {
    background-color: #7f8c8d;
}

/* Craving Slider */
.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.craving-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #27ae60, #f39c12, #e74c3c);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 15px;
}

.craving-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2c3e50;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.craving-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2c3e50;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.craving-value {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
}

.craving-value strong {
    color: #e74c3c;
    font-size: 24px;
}

/* Reaction Time Test */
.reaction-area {
    background-color: #ecf0f1;
    border: 3px solid #bdc3c7;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    margin: 20px 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reactionPrompt, #trialReactionPrompt {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

#reactionButton, #trialReactionButton {
    font-size: 24px;
    padding: 30px 60px;
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

.instruction {
    color: #7f8c8d;
    font-style: italic;
    margin: 10px 0;
}

/* Cue Display */
.cue-display {
    background-color: #34495e;
    color: white;
    padding: 40px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1.8;
    margin: 20px 0;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer {
    text-align: center;
    font-size: 18px;
    color: #e74c3c;
    font-weight: 600;
    margin: 15px 0;
}

/* Recovery Section */
.recovery-message {
    background-color: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.recovery-message p {
    font-size: 18px;
    color: #27ae60;
    font-weight: 600;
    margin: 0;
}

/* Summary Section */
.summary-section {
    margin: 30px 0;
}

#cravingChart {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#summaryStats {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

#summaryStats p {
    margin: 8px 0;
    font-size: 15px;
}

.next-steps {
    background-color: #e8f5e9;
    border-left: 4px solid #27ae60;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

/* Support Info */
.support-info {
    background-color: #fff3e0;
    border: 2px solid #f39c12;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.support-info h3 {
    color: #f39c12;
    margin-top: 0;
}

.support-info ul {
    margin-left: 20px;
    margin-top: 10px;
}

.support-info li {
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 0;
    }

    header {
        padding: 15px 20px;
    }

    header h1 {
        font-size: 20px;
    }

    .exit-button {
        position: static;
        display: block;
        margin-top: 15px;
        width: 100%;
    }

    .screen {
        padding: 20px;
    }

    h2 {
        font-size: 22px;
    }

    .reaction-area {
        padding: 30px;
        min-height: 150px;
    }

    #reactionPrompt, #trialReactionPrompt {
        font-size: 24px;
    }

    #reactionButton, #trialReactionButton {
        font-size: 18px;
        padding: 20px 40px;
    }

    .cue-display {
        padding: 25px;
        font-size: 18px;
    }
}
