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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

main {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.system-prompt-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #fef3c7 100%);
    border: 1px solid #facc15;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 30px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notice-text {
    flex: 1;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.4;
}

.notice-text strong {
    color: #78350f;
}

.notice-settings-link {
    background: none;
    border: none;
    color: #1d4ed8;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notice-settings-link:hover {
    background: rgba(29, 78, 216, 0.1);
    text-decoration: none;
}

.notice-close {
    background: none;
    border: none;
    color: #92400e;
    font-size: 1.3rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notice-close:hover {
    background: rgba(146, 64, 14, 0.1);
    color: #78350f;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    height: 100%;
    align-items: start;
}

.left-panel {
    display: flex;
    flex-direction: column;
    align-self: start;
}

.right-panel {
    display: flex;
    flex-direction: column;
    align-self: start;
}

.upload-section {
    margin-bottom: 0;
}

.upload-area {
    border: 3px dashed #e1e5e9;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafbfc;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: scale(1.02);
}

.upload-content .upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-content h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.browse-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: #5a6fd8;
}

.file-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
}

.file-text {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
}

.progress-section {
    margin: 30px 0;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.upload-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.options-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.audio-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.audio-toggle input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.toggle-text {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.audio-toggle small {
    color: #666;
    font-size: 0.9rem;
    margin-left: 24px;
}

.video-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
}

.video-toggle input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.video-toggle small {
    color: #666;
    font-size: 0.9rem;
    margin-left: 24px;
}

.intro-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
    padding: 15px;
    border: 2px dashed #ff6b6b;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
}

.intro-toggle input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.intro-toggle small {
    color: #d63031;
    font-size: 0.9rem;
    margin-left: 24px;
    font-weight: 500;
}

.intro-toggle:hover {
    background: linear-gradient(135deg, #ffe8e8, #ffdddd);
    border-color: #ff5252;
}

.zoom-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
    padding: 15px;
    border: 2px dashed #2d3748;
    border-radius: 8px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
}

.zoom-toggle input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.zoom-toggle small {
    color: #4a5568;
    font-size: 0.9rem;
    margin-left: 24px;
    font-weight: 500;
}

.zoom-toggle:hover {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    border-color: #4a5568;
}

.context-input {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.context-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    cursor: text;
}

.context-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.context-label small {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.context-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.context-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.context-textarea::placeholder {
    color: #999;
    font-style: italic;
}

.audio-section {
    background: #f0f8ff;
    border: 1px solid #e1f0ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.audio-section h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audio-player audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: #fff;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.video-section {
    background: #fff8f0;
    border: 1px solid #ffe4cc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.video-section h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.video-player {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.zoom-sections {
    background: #f0f8ff;
    border: 1px solid #cce7ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.zoom-sections h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.zoom-info {
    margin-bottom: 15px;
}

.zoom-info p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.zoom-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zoom-item {
    background: white;
    border: 1px solid #e6f3ff;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.zoom-item:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.zoom-item-header {
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 12px;
}

.zoom-timestamp {
    background: #4a90e2;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: fit-content;
}

.zoom-description {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    flex: 1;
}

.zoom-narration {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 4px 0;
}

.zoom-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #666;
}

.zoom-coordinate {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.zoom-level {
    background: #e3f2fd;
    color: #1565c0;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #bbdefb;
    font-weight: 600;
}

.zoom-json-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    animation: slideIn 0.3s ease-out;
}

.zoom-json-section h4 {
    color: #2c5aa0;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.json-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.json-info p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

.json-actions {
    display: flex;
    gap: 8px;
}

.copy-json-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-json-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.json-container {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.json-display {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    margin: 0;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cli-command {
    background: #2d3748;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.cli-command p {
    color: #e2e8f0;
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.cli-command code {
    display: block;
    background: #1a202c;
    color: #68d391;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.3;
    overflow-x: auto;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cli-command .copy-json-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4299e1;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.cli-command .copy-json-btn:hover {
    background: #3182ce;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.transcript-header h4 {
    color: #333;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.edit-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.save-edit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.save-edit-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.cancel-edit-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.cancel-edit-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.regen-btn {
    background: #fd7e14;
    border-color: #fd7e14;
}

.regen-btn:hover {
    background: #e66b02;
    border-color: #e66b02;
}

.results-section {
    border-top: 1px solid #e9ecef;
    padding-top: 40px;
}

.results-section h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.transcript-container {
    margin-bottom: 30px;
}

.transcript-text {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    background: #fafbfc;
}

.transcript-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.transcript-text.editing {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    background: #f8fff9;
}

.transcript-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 160px;
}

.action-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: #6c757d;
}

.action-btn.secondary:hover {
    background: #5a6268;
}

.settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.settings-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px 0 30px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
}

.settings-header h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.settings-body {
    padding: 30px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    cursor: text;
}

.setting-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.setting-label small {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.setting-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.setting-hint small {
    color: #5a67d8;
    font-size: 0.85rem;
}

.system-prompt-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.system-prompt-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.system-prompt-textarea::placeholder {
    color: #999;
    font-style: italic;
}

.setting-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-select option {
    padding: 10px;
}

.settings-footer {
    padding: 0 30px 30px 30px;
    display: flex;
    justify-content: flex-end;
}

.save-settings-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-settings-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(calc(100% + 20px));
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 600;
    max-width: 350px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #17a2b8;
}

.hidden {
    display: none !important;
}

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .main-container {
        gap: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-content h3 {
        font-size: 1.3rem;
    }
    
    .transcript-actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: auto;
    }
    
    .settings-btn {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}