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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

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

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.version-info {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.version-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.version-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 400;
}

.video-demo-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-demo-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.video-demo-btn svg {
    width: 16px;
    height: 16px;
}

.main-content {
    display: grid;
    gap: 30px;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-card,
.job-specs-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.cv-selection-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.upload-card h2,
.job-specs-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

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

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

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #667eea;
}

.upload-area p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4a5568;
}

.upload-subtext {
    font-size: 0.9rem;
    color: #718096;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0fff4;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
}

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

.file-icon {
    width: 24px;
    height: 24px;
    color: #38a169;
    flex-shrink: 0;
}

.file-text {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
}

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

.remove-file {
    background: #fed7d7;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e53e3e;
    font-size: 16px;
    transition: all 0.2s ease;
}

.remove-file:hover {
    background: #feb2b2;
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2d3748;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.cv-select {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e0;
    font-weight: 500;
}

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

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.sample-section {
    margin-bottom: 30px;
}

.sample-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.sample-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
}

.sample-description {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1rem;
}

.sample-content {
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.sample-letter {
    padding: 30px;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #2d3748;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #667eea;
    position: relative;
}

.sample-letter::before {
    content: "📄 Sample Output";
    position: absolute;
    top: 10px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.generate-section {
    text-align: center;
}

.support-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.support-notice {
    margin-bottom: 20px;
}

.support-notice p {
    color: #fbbf24;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    padding: 10px 15px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.support-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.support-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.support-btn svg {
    width: 18px;
    height: 18px;
}

.build-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 2px solid transparent;
}

.build-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.coffee-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: 2px solid transparent;
}

.coffee-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.generate-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: 3px solid #ffffff;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    min-width: 200px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
    border-color: #ffffff;
}

.generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.generate-btn:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #ecf0f1;
    border-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
}

.result-section {
    margin-top: 30px;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.result-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f7fafc;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.cover-letter {
    background: #f7fafc;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #2d3748;
}

.error-message,
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.error-message.show,
.success-message.show {
    transform: translateX(0);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.success-message {
    background: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.error-icon,
.success-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-card,
    .job-specs-card,
    .sample-card {
        padding: 20px;
    }
    
    .sample-letter {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    .sample-letter::before {
        position: static;
        display: block;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .result-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .result-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    .support-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .support-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .support-section {
        margin-top: 20px;
        padding: 15px;
    }
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.youtube-link:hover svg {
    fill: #ff0000;
}

.linkedin-link:hover svg {
    fill: #0077b5;
}

.github-link:hover svg {
    fill: #333333;
}

.website-link:hover svg {
    fill: #4CAF50;
}

.footer-text {
    margin: 0;
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-text br {
    display: none;
}

/* Debug Section Styles */
.debug-section {
    margin-top: 30px;
}

.debug-card {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: white;
    border: 2px solid #4a5568;
}

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

.debug-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f7fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.debug-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.debug-toggle,
.debug-copy {
    background: #4a5568;
    border: 1px solid #718096;
    color: #f7fafc;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.debug-toggle:hover,
.debug-copy:hover {
    background: #667eea;
    border-color: #667eea;
    transform: translateY(-1px);
}

.debug-toggle:active,
.debug-copy:active {
    transform: translateY(0);
}

.debug-copy {
    background: #38a169;
    border-color: #38a169;
}

.debug-copy:hover {
    background: #2f855a;
    border-color: #2f855a;
}

.debug-content {
    display: grid;
    gap: 20px;
}

.debug-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-item label {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-item textarea {
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 12px;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Special styling for prompt textarea */
.debug-item textarea#debugPrompt {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border: 2px solid #4a5568;
    font-size: 0.8rem;
    line-height: 1.5;
    min-height: 200px;
    max-height: 600px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.debug-item textarea#debugPrompt:focus {
    border-color: #667eea;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.debug-item textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.debug-item span {
    background: #4a5568;
    padding: 8px 12px;
    border-radius: 6px;
    color: #f7fafc;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    border: 1px solid #718096;
}

.prompt-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.prompt-length,
.prompt-status {
    font-size: 0.8rem;
    color: #a0aec0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prompt-status {
    padding: 4px 8px;
    border-radius: 4px;
    background: #2d3748;
    border: 1px solid #4a5568;
}

.prompt-status.success {
    background: #38a169;
    border-color: #38a169;
    color: #f7fafc;
}

.prompt-status.warning {
    background: #d69e2e;
    border-color: #d69e2e;
    color: #1a202c;
}

.prompt-status.error {
    background: #e53e3e;
    border-color: #e53e3e;
    color: #f7fafc;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-text {
        text-align: center;
    }
    
    .footer-text br {
        display: block;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .debug-card {
        padding: 20px;
    }
    
    .debug-content {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .social-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 1.5rem 0;
    }
    
    .social-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        width: 100%;
    }
    
    .social-link {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.video-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.video-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.video-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.video-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.video-modal-close svg {
    width: 20px;
    height: 20px;
}

.video-modal-body {
    padding: 0;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.video-info p {
    margin: 0 0 15px 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.1);
}

.video-link:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: translateY(-2px);
}

.video-link svg {
    width: 18px;
    height: 18px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Video Modal */
@media (max-width: 768px) {
    .video-modal-content {
        width: 98%;
        max-height: 85vh;
    }
    
    .video-modal-header {
        padding: 15px 20px;
    }
    
    .video-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .video-info {
        padding: 15px 20px;
    }
    
    .video-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .video-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .video-modal-header {
        padding: 12px 15px;
    }
    
    .video-modal-header h3 {
        font-size: 1rem;
    }
    
    .video-info {
        padding: 12px 15px;
    }
}
