/* Basic Reset & Page Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden; /* Prevents any scrolling */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f0f1e; /* Dark background */
    color: #e0e0e0; /* Light text color */
    user-select: none; /* Prevents text selection on mobile */
}

/* Main App Container */
.app-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

/* Logo */
.app-logo {
    display: block;
    width: 120px;
    height: auto;
}

/* App Title */
.app-title {
    font-size: 3.5rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 5px;
}

.app-subtitle {
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 30px;
}

/* Controls Wrapper */
.controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 10px;
}

/* Individual Control Group (Label + Input) */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-size: 1rem;
    color: #e0e0e0;
    text-align: left;
}

/* Custom Select Dropdown */
#mode-selector {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    background-color: #2a2a3e;
    color: #ffffff;
    border: 1px solid #3a3a5e;
    border-radius: 12px;
    -webkit-appearance: none; /* Removes default styling on WebKit browsers */
    appearance: none; /* Standard property for other browsers */
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23ffffff%22%3E%3Cpath%20d%3D%22M7%2010l5%205%205-5z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px; /* Make space for the arrow */
}

#mode-selector:focus {
    outline: none;
    border-color: #5a5a8e;
    box-shadow: 0 0 0 2px rgba(90, 90, 142, 0.5);
}

/* Intensity Slider */
#intensity-slider {
    width: 100%;
    height: 8px;
    background-color: #2a2a3e;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none; /* Removes default styling on WebKit browsers */
    appearance: none; /* Standard property for other browsers */
}

#intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none; /* Vendor-prefixed for WebKit/Blink */
    appearance: none; /* Standard property for compatibility */
    width: 24px;
    height: 24px;
    background-color: #b0b0b0;
    border-radius: 50%;
    cursor: pointer;
}

#intensity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background-color: #b0b0b0;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#intensity-value {
    font-size: 1rem;
    color: #b0b0b0;
    font-weight: bold;
}

/* --- Main Action Button (with progress) --- */
.action-button {
    width: 150px;
    height: 150px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #0f0f1e;
    background-color: #8a8aae;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    background-color: #a0a0be;
}

.action-button:active {
    transform: scale(0.95);
}

/* --- Active state with progress effect --- */
.action-button.active {
    color: #ffffff;
    /* --- CHANGE: Updated to a more harmonious, deeper red --- */
    background-color: #c0392b;
}

.action-button.active:hover {
    /* --- CHANGE: Updated hover to an even deeper red --- */
    background-color: #a93226;
}

/* Status Message */
.status-message {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #b0b0b0;
    min-height: 20px; /* Prevents layout shift when text appears */
}

/* --- FINAL ATTEMPT TO REMOVE BLUE SQUARE --- */
.action-button:focus {
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent; /* Removes the tap highlight on iOS */
    -moz-outline-style: none; /* For older Firefox */
}

/* FOOTER */
.app-footer {
    padding-top: 10px;
    border-top: 1px solid #333;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

.app-footer a {
    color: #b0b0b0;
    text-decoration: none;
    margin: 0 5px;
}

.separator {
    margin: 0 10px;
    color: #555;
}


/* --- Privacy Page Overrides --- */

/* Target the html and body elements specifically for the privacy page */
/* We need to target html because the global rule applies to both */
html:has(body.privacy-body),
body.privacy-body {
    height: auto !important;
    min-height: 100vh !important;
    overflow: auto !important;
}

/* Fallback for browsers that do not support :has() */
/* If the above doesn't work, this targets body specifically, 
   but requires the browser to respect body overflow (most modern ones do) */
body.privacy-body {
    overflow: auto !important;
    height: auto !important;
}

/* Container overrides */
.privacy-page {
    height: auto !important;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
    user-select: auto;
}

/* Privacy Title Styling */
.privacy-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 20px;
}

/* Content Container Styling */
.privacy-content {
    width: 100%;
    max-width: 600px;
    text-align: left;
    margin-bottom: 40px;
}

/* Heading Styling inside Privacy Content */
.privacy-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Paragraph Styling inside Privacy Content */
.privacy-content p {
    font-size: 1rem;
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* List Styling inside Privacy Content */
.privacy-content ul {
    list-style-position: inside;
    color: #b0b0b0;
    margin-left: 20px;
    margin-bottom: 10px;
}

.privacy-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Back Link Styling */
.back-link {
    margin-top: 30px;
    text-align: center;
}

.back-link a {
    color: #8a8aae;
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    color: #a0a0be;
    text-decoration: underline;
}

/* --- About Page Overrides --- */

/* Target html and body specifically for the about page to unlock scroll */
html:has(body.about-body),
body.about-body {
    height: auto !important;
    min-height: 100vh !important;
    overflow: auto !important;
}

/* Container overrides */
.about-page {
    height: auto !important;
    min-height: 100vh;
    justify-content: flex-start; /* Align content to top */
    padding-top: 40px;
    padding-bottom: 40px;
    user-select: auto; /* Allow text selection */
}

/* About Title Styling */
.about-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 20px;
}

/* Content Container Styling */
.about-content {
    width: 100%;
    max-width: 600px;
    text-align: left;
    margin-bottom: 40px;
}

/* Headings inside About Content */
.about-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 30px;
    margin-bottom: 15px;
}

.about-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Paragraph Styling */
.about-content p {
    font-size: 1rem;
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* List Styling */
.about-content ul {
    list-style-position: inside;
    color: #b0b0b0;
    margin-left: 20px;
    margin-bottom: 10px;
}

.about-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Back Link Styling */
.back-link {
    margin-top: 30px;
    text-align: center;
}

.back-link a {
    color: #8a8aae;
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    color: #a0a0be;
    text-decoration: underline;
}

a {
    color: #b0b0b0;
    font-weight: 500;
}