/* Large Marge - File Upload Styles */

/* Tailwind Rainbow Demo - These classes will be colorized */
.demo {
    @apply sm:p-4 lg:p-8 hover:bg-blue-500 dark:text-white;
    @apply min-w-[100px] focus:ring-2 checked:border-green-500;
    @apply [aspect-ratio:16/9] md:hover:opacity-75;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.resume-section {
    margin-bottom: 2rem;
}

.resume-banner {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 100%);
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.resume-info h3 {
    margin: 0 0 0.5rem 0;
    color: #667eea;
    font-size: 1.2rem;
}

.resume-info p {
    margin: 0.25rem 0;
    color: #333;
}

.resume-dismiss {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.resume-dismiss:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.upload-section {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.job-name-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.job-name-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.job-name-input::placeholder {
    color: #999;
}

.job-name-hint {
    color: #666;
    font-size: 0.8rem;
}

.file-input-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-input-label {
    display: block;
    padding: 2rem;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.file-input-label:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.file-input-text {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 500;
}

.file-info {
    background: #f8f9ff;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-name {
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
    background: #e8ebff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.extract-options {
    background: #f8f9ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.interval-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e1e5e9;
}

.interval-wrapper label {
    color: #666;
    font-size: 0.9rem;
}

.interval-wrapper input[type="number"] {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.9rem;
}

.interval-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.upload-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.upload-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.progress-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

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

#progress-text {
    font-weight: 600;
    color: #667eea;
}

#upload-status {
    color: #666;
    font-style: italic;
}

/* Extraction Progress Section */
.extraction-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border: 1px solid #7dd3fc;
}

.extraction-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.extraction-icon {
    font-size: 1.5rem;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.extraction-title {
    font-weight: 600;
    color: #0369a1;
    font-size: 1rem;
}

.extraction-bar {
    background: #bae6fd;
}

.extraction-fill {
    background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
}

.extraction-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

#extraction-progress {
    font-weight: 600;
    color: #0284c7;
}

#extraction-status {
    color: #0369a1;
    font-style: italic;
}

.extraction-stats {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #7dd3fc;
    display: flex;
    gap: 1rem;
}

.extraction-stats .stat {
    background: #0284c7;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* AI Analysis Section */
.ai-analysis-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3f2 0%, #fee2e2 100%);
    border-radius: 10px;
    border: 1px solid #fca5a5;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-icon {
    font-size: 1.5rem;
}

.ai-title {
    font-weight: 600;
    color: #dc2626;
    font-size: 1rem;
}

.ai-prompt-wrapper {
    margin-bottom: 1rem;
}

.ai-prompt-wrapper label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ai-prompt-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.ai-prompt-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.analyze-button {
    width: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analyze-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

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

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    color: #dc2626;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #fca5a5;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.ai-result {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #fca5a5;
}

.ai-result h4 {
    margin: 0 0 0.75rem 0;
    color: #dc2626;
    font-size: 0.95rem;
}

.ai-result-content {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
}

.result-message {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Media Key Display */
.media-key-section {
    background: #1a1a2e;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.media-key-section p {
    color: #a0a0a0;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.media-key {
    display: block;
    background: #0f0f1a;
    color: #4ade80;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    margin-bottom: 0.75rem;
    border: 1px solid #333;
}

.copy-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

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

/* Truck Animation Styles */
.truck-animation {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: linear-gradient(135deg, #87CEEB 0%, #98D8E8 100%);
    border-radius: 12px;
    margin-top: 1rem;
    border: 3px solid #FFD700;
}

.truck-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.truck {
    font-size: 4rem;
    position: absolute;
    left: -100px;
    transition: all 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.truck-animation.truck-drive-in .truck {
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 0.5s ease-in-out 2s;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.marge-message {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 1s ease-in-out 2.5s;
}

.truck-animation.truck-drive-in .marge-message {
    opacity: 1;
}

.speech-bubble {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    border: 3px solid #FF4500;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    max-width: 200px;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 15px solid #FF4500;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid white;
}

.speech-bubble p {
    margin: 0.25rem 0;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.speech-bubble strong {
    color: #FF4500;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Sticky Footer */
.sticky-footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
    text-align: center;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.footer-content a {
    color: #87CEEB;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .file-input-label {
        padding: 1.5rem;
    }
    
    .file-details {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation for form elements */
.upload-form > * {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}