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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-bottom: clamp(1rem, 3vw, 2rem);
    background: white;
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
    justify-content: center;
}

h1 {
    width: 100%;
    text-align: center;
    color: #2196f3;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.container > p {
    width: 100%;
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: clamp(0.875rem, 2vw, 1rem);
    padding: 0 1rem;
}

.column {
    flex: 1 1 300px;
    min-width: 280px;
    max-width: 500px;
    background: #f8f9fa;
    border-radius: clamp(12px, 2vw, 16px);
    padding: clamp(1.25rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    border: 2px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.column:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.2);
}

.file-upload-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.live-record {
    background: linear-gradient(180deg, #fff0f0, #ffeaea);
}

.subtitle {
    color: #555;
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    text-align: center;
}

.file-upload-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px dashed #2196f3;
    border-radius: clamp(8px, 1.5vw, 12px);
    padding: clamp(0.75rem, 2vw, 1rem);
    transition: all 0.3s ease;
}

.file-upload-group:hover {
    background: #f0f8ff;
    border-color: #1976d2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.file-label {
    text-align: center;
    color: #2196f3;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: clamp(0.875rem, 1.8vw, 1rem);
}

.file-label:hover {
    color: #1976d2;
}

input[type="file"] {
    display: none;
}

select#fileList {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 1rem);
    padding-right: clamp(2rem, 4vw, 2.5rem);
    font-size: clamp(0.875rem, 1.8vw, 1rem);
    color: #333;
    background: white;
    border: 2px solid #2196f3;
    border-radius: clamp(8px, 1.5vw, 12px);
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%232196f3' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right clamp(0.75rem, 2vw, 1rem) center;
    background-size: 12px 8px;
}

select#fileList:hover {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

select#fileList:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

#audioContainer {
    width: 100%;
    min-height: clamp(60px, 12vw, 80px);
    background: white;
    border-radius: clamp(8px, 1.5vw, 12px);
    padding: clamp(0.75rem, 2vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}

#audioContainer audio {
    max-width: 100%;
    width: 100%;
}

button {
    padding: clamp(0.75rem, 1.5vw, 0.875rem) clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(0.875rem, 1.8vw, 1rem);
    font-weight: 600;
    border: none;
    border-radius: clamp(8px, 1.5vw, 12px);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#submitBtn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

#submitBtn:active {
    transform: translateY(0);
}

#submitBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.record-btn {
    width: clamp(80px, 15vw, 100px);
    height: clamp(80px, 15vw, 100px);
    border-radius: 50%;
    font-size: clamp(2.5rem, 5vw, 3rem);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.record-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.record-btn:active {
    transform: scale(0.95);
}

.record-btn.recording {
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 82, 82, 0.4);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 82, 82, 0.8);
    }
}

#status {
    text-align: center;
    color: #555;
    padding: 0.5rem 1rem;
    min-width: clamp(150px, 30vw, 180px);
    font-size: clamp(0.875rem, 1.8vw, 1rem);
}

#saveBtn {
    text-align: center;
    color: #FFFFFF;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: clamp(8px, 1.5vw, 12px);
    min-width: clamp(150px, 30vw, 180px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-transform: none;
}

#saveBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#saveBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.result-box {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto clamp(1rem, 3vw, 2rem);
    background: white;
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-label {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #2196f3;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #e9ecef;
}

.result-content {
    background: #f8f9fa;
    border-radius: clamp(8px, 1.5vw, 12px);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    min-height: clamp(80px, 15vw, 100px);
    color: #333;
    line-height: 1.6;
    font-size: clamp(0.875rem, 1.8vw, 1rem);
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.result-content:empty::before {
    content: "Waiting for transcription...";
    color: #999;
    font-style: italic;
}

#summaryText:empty::before {
    content: "Waiting for summary...";
    color: #999;
    font-style: italic;
}

/* Tablet landscape and below */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    .column {
        max-width: 100%;
    }
}

/* Tablet portrait and below */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .column {
        min-width: 100%;
    }
    
    .column:hover {
        transform: none;
    }
    
    .record-btn:hover {
        transform: scale(1.05);
    }
    
    button:hover {
        transform: translateY(-1px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 0.75rem;
    }
    
    .container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .column {
        padding: 1rem;
        min-width: 100%;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .container > p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .record-btn {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .file-upload-group {
        padding: 0.75rem;
    }
    
    select#fileList {
        padding-right: 2rem;
        background-position: right 0.75rem center;
    }
    
    #status,
    #saveBtn {
        min-width: 120px;
        font-size: 0.875rem;
    }
    
    .result-box {
        padding: 1rem;
    }
    
    .result-content {
        min-height: 60px;
        font-size: 0.875rem;
    }
}

/* Extra small mobile */
@media (max-width: 360px) {
    h1 {
        font-size: 1.25rem;
    }
    
    .record-btn {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    button {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.prompt-box {
    background: white;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: clamp(12px, 2vw, 20px);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
}

.prompt-box h3 {
    color: #2196f3;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
}

.prompt-box input {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 1rem);
    margin-top: 1rem;
    font-size: clamp(0.875rem, 1.8vw, 1rem);
    border-radius: clamp(8px, 1.5vw, 12px);
    border: 2px solid #2196f3;
    transition: all 0.3s ease;
    font-family: inherit;
}

.prompt-box input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.prompt-box button {
    padding: clamp(0.75rem, 1.5vw, 0.875rem) clamp(1.5rem, 3vw, 2rem);
    margin-top: 1.5rem;
    font-size: clamp(0.875rem, 1.8vw, 1rem);
    font-weight: 600;
    border: none;
    border-radius: clamp(8px, 1.5vw, 12px);
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.prompt-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.prompt-box button:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .prompt-box {
        width: 95%;
        padding: 1.5rem;
    }
}