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

:root {
    --primary: #ffffff;
    --primary-hover: #e0e0e0;
    --danger: #ffffff;
    --danger-hover: #e0e0e0;
    --success: #ffffff;
    --warning: #ffffff;
    --bg: #000000;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #333333;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Recording Tips */
.recording-tips {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.recording-tips h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.recording-tips ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recording-tips li {
    font-size: 0.875rem;
    color: var(--text);
    padding: 0.25rem 0;
    line-height: 1.5;
}

/* Recorder */
.recorder-container {
    text-align: center;
    margin-bottom: 2rem;
}

.timer {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-record {
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
}

.btn-record:hover:not(:disabled) {
    background: #e0e0e0;
    transform: scale(1.02);
}

.btn-record.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
}

.btn-stop {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-stop:hover:not(:disabled) {
    background: var(--border);
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    justify-content: center;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Preview Section */
.preview-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.preview-section audio {
    width: 100%;
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* Transcript */
.transcript-section {
    margin-bottom: 1.5rem;
}

.transcript-section label,
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

textarea,
input[type="text"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Metadata */
.metadata-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

select {
    cursor: pointer;
}

/* Consent */
.consent-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.consent-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.consent-label:hover .checkmark {
    border-color: var(--primary);
}

.consent-label input[type="checkbox"]:checked ~ .checkmark {
    background: #ffffff;
    border-color: #ffffff;
}

.checkmark::after {
    content: '✓';
    color: #000000;
    font-size: 14px;
    font-weight: bold;
    display: none;
}

.consent-label input[type="checkbox"]:checked ~ .checkmark::after {
    display: block;
}

.consent-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}


/* Upload Status */
.upload-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.upload-status.success {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid #ffffff;
}

.upload-status.error {
    background: rgba(255, 255, 255, 0.05);
    color: #888888;
    border: 1px solid #888888;
}

.upload-status.loading {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid #ffffff;
}

/* Samples Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.sample-item {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.sample-info {
    flex: 1;
}

.sample-transcript {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.sample-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.sample-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sample-audio {
    width: 100%;
}

.sample-audio audio {
    width: 100%;
    height: 40px;
}

.sample-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-delete {
    background: transparent;
    color: #888888;
    padding: 0.5rem;
}

.btn-delete:hover {
    background: rgba(255, 255, 255, 0.1);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #ffffff;
    color: #000000;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.5rem;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .metadata-section {
        grid-template-columns: 1fr;
    }

    .sample-header {
        flex-direction: column;
    }
}
