/* Global Styles */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --dark-color: #202124;
    --gray-color: #5f6368;
    --light-gray: #f8f9fa;
    --border-color: #dadce0;
    --shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-hover: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}

* {
    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: var(--dark-color);
    background-color: var(--light-gray);
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    text-align: center;
}

header h1 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--gray-color);
    font-size: 1.1rem;
}

/* Navigation */
.breadcrumb {
    padding: 1rem 2rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--gray-color);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Landing Page Styles */
.hero-section {
    background-color: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hero-content {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray-color);
    max-width: 600px;
    margin: 0 auto;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.card p {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
}

/* Button Styles */
.button {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.button-primary {
    background-color: var(--primary-color);
    color: white;
}

.button-primary:hover:not(:disabled) {
    background-color: #1557b0;
    box-shadow: var(--shadow);
}

.button-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.button-secondary:hover {
    background-color: var(--light-gray);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Features Section */
.features {
    background-color: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
}

.feature h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--gray-color);
}

/* Enrollment/Verification Card */
.enrollment-card,
.verification-card {
    background-color: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 2rem;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    color: var(--gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.step.active {
    background-color: var(--primary-color);
    color: white;
}

.step.completed {
    background-color: var(--secondary-color);
    color: white;
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-section input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-section input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-section small {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* Prompts Section */
.prompts-section {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.prompts-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.prompt-list {
    margin-left: 1.5rem;
    color: var(--gray-color);
}

.prompt-list li {
    margin-bottom: 0.5rem;
}

/* Recording Section */
.current-prompt,
.verification-prompt {
    text-align: center;
    margin-bottom: 2rem;
}

.prompt-label {
    display: block;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.prompt-text {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--dark-color);
    display: block;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 4px;
}

.prompt-display {
    margin-top: 1rem;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.record-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.record-button:hover {
    background-color: #1557b0;
    box-shadow: var(--shadow);
}

.record-button.recording {
    background-color: var(--danger-color);
}

.record-button.recording:hover {
    background-color: #c72e21;
}

/* Audio Visualizer */
.audio-visualizer {
    width: 100%;
    max-width: 400px;
    height: 100px;
    background-color: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    display: none;
}

.audio-visualizer.active {
    display: block;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
}

/* Recording Status */
.recording-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger-color);
    font-weight: 500;
}

.recording-indicator.hidden {
    display: none;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background-color: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.timer {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gray-color);
}

/* Recorded Samples */
.recorded-samples {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--light-gray);
    border-radius: 4px;
}

.recorded-samples h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.samples-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.sample-number {
    font-weight: 600;
    color: var(--gray-color);
    margin-right: 0.5rem;
}

.sample-text {
    flex: 1;
    color: var(--dark-color);
}

.sample-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.sample-status.pending {
    background-color: var(--light-gray);
    color: var(--gray-color);
}

.sample-status.completed {
    background-color: #e6f4ea;
    color: var(--secondary-color);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Messages */
.success-message,
.error-message {
    text-align: center;
    padding: 2rem;
    border-radius: 4px;
    margin-top: 2rem;
}

.success-message {
    background-color: #e6f4ea;
    color: var(--secondary-color);
}

.success-message svg {
    margin-bottom: 1rem;
}

.success-message h3 {
    margin-bottom: 0.5rem;
}

.error-message {
    background-color: #fce8e6;
    color: var(--danger-color);
}

.hidden {
    display: none !important;
}

/* Verification Result */
.verification-result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 4px;
    text-align: center;
}

.verification-result.success {
    background-color: #e6f4ea;
    border: 1px solid var(--secondary-color);
}

.verification-result.failure {
    background-color: #fce8e6;
    border: 1px solid var(--danger-color);
}

.result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Security Notice */
.security-notice {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #e8f0fe;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.security-notice h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.security-notice p {
    color: var(--gray-color);
}

/* Footer */
footer {
    background-color: white;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--gray-color);
}

/* Language Selector */
.language-selector-wrapper {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.language-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    color: var(--dark-color);
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    min-width: 120px;
    font-family: inherit;
}

.language-selector:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.language-selector:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.language-selector option {
    padding: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Global responsive adjustments */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    /* Hero section responsive */
    .hero-section {
        padding: 2rem 1.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    /* Card grid responsive */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* How it works responsive */
    .steps {
        flex-direction: column;
        gap: 2rem;
    }
    
    .step {
        width: 100%;
    }
    
    /* Forms responsive */
    .enrollment-card,
    .verification-card {
        padding: 1.5rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
    }
    
    .form-section label {
        font-size: 0.9rem;
    }
    
    .form-section input,
    .form-section select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Recording section responsive */
    .recording-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .record-button {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .audio-visualizer {
        width: 100%;
        height: 120px;
        margin: 1rem 0;
    }
    
    #visualizerCanvas {
        width: 100%;
        height: 100%;
    }
    
    /* Buttons responsive */
    .button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .button {
        width: 100%;
    }
    
    /* Verification result responsive */
    .result-content {
        padding: 1.5rem;
    }
    
    .result-icon svg {
        width: 48px;
        height: 48px;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    .result-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        text-align: center;
    }
    
    /* Error and success messages responsive */
    .error-message,
    .success-message {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    /* Step indicator responsive */
    .step-indicator {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .step {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Language selector responsive */
    .language-selector-wrapper {
        position: static;
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }
    
    .language-selector {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 1.5rem 1rem;
    }
    
    .enrollment-card,
    .verification-card {
        padding: 1rem;
    }
    
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .current-prompt {
        padding: 0.75rem;
    }
    
    .prompt-text {
        font-size: 1rem;
    }
    
    .timer {
        font-size: 1.5rem;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) {
    .button:active {
        transform: scale(0.98);
    }
    
    .record-button:active {
        transform: scale(0.98);
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .button:hover {
        background-color: var(--primary-color);
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    header {
        padding: 1rem 0;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        display: none;
    }
    
    main {
        padding: 1rem;
    }
    
    .hero-section {
        padding: 1.5rem;
    }
    
    .audio-visualizer {
        height: 80px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 0 0 2px currentColor;
        --shadow-hover: 0 0 0 3px currentColor;
    }
    
    .button {
        border: 2px solid currentColor;
    }
    
    .record-button {
        border: 2px solid currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #1a1a1a;
        --dark-color: #e8eaed;
        --gray-color: #9aa0a6;
        --border-color: #3c4043;
    }
    
    body {
        background-color: #0d0d0d;
    }
    
    header,
    .hero-section,
    .card,
    .enrollment-card,
    .verification-card,
    .breadcrumb,
    footer {
        background-color: #1a1a1a;
    }
    
    .language-selector {
        background-color: #1a1a1a;
        color: var(--dark-color);
    }
    
    .form-section input,
    .form-section select,
    .form-section textarea {
        background-color: #2d2d2d;
        color: var(--dark-color);
        border-color: var(--border-color);
    }
    
    .audio-visualizer {
        background-color: #0d0d0d;
    }
}
@media (max-width: 768px) {
    .action-cards {
        grid-template-columns: 1fr;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .enrollment-card,
    .verification-card {
        padding: 2rem 1.5rem;
    }
    
    .result-details {
        flex-direction: column;
        gap: 1rem;
    }
}