/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

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

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 10px;
}

.home-link {
    text-decoration: none;
    color: inherit;
}

.home-link:hover {
    color: #3498db;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
    margin-bottom: 15px;
}

.nav-links {
    margin-top: 15px;
}

.nav-link {
    display: inline-block;
    margin: 0 10px;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #2980b9;
    transform: translateY(-1px);
    color: white;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-main {
    gap: 30px;
}

/* Upload section */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.instructions {
    margin-bottom: 40px;
    text-align: center;
}

.instructions h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 400;
}

.instructions ol {
    display: inline-block;
    text-align: left;
    max-width: 400px;
}

.instructions li {
    margin-bottom: 8px;
    color: #555;
    font-size: 1rem;
}

.features-note {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.features-note p {
    margin: 0;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Upload form */
.upload-form {
    max-width: 500px;
    margin: 0 auto;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#videoFile {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.file-input-label:hover {
    border-color: #3498db;
    background: #ebf3fd;
}

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

.upload-btn {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

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

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.format-info {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Result and error sections */
.result-section,
.error-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.result-section h3 {
    color: #27ae60;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 400;
}

.error-section h3 {
    color: #e74c3c;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 400;
}

.result-item,
.share-item {
    margin-bottom: 25px;
}

.result-item label,
.share-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

/* Embed options styling */
.embed-options {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.embed-size-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.embed-behavior-options h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 500;
}

.embed-behavior-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-option:hover,
.checkbox-option:hover {
    color: #2c3e50;
}

.radio-option input[type="radio"]:checked + span,
.checkbox-option input[type="checkbox"]:checked + span {
    font-weight: 500;
    color: #3498db;
}

.embed-generator-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.embed-generator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.embed-link-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.url-container {
    display: flex;
    gap: 10px;
}

.url-container input,
.url-container textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.url-container textarea {
    resize: vertical;
    min-height: 80px;
}

.copy-btn {
    padding: 12px 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #229954;
}

.result-actions,
.upload-another {
    text-align: center;
    margin-top: 25px;
}

.secondary-btn {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.secondary-btn:hover {
    background: #3498db;
    color: white;
}

/* Video player styles */
.video-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

#videoPlayer {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

.video-info {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.share-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 400;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.error-message p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-section,
    .result-section,
    .error-section,
    .video-info {
        padding: 25px 20px;
    }

    .instructions ol {
        max-width: 100%;
    }

    .url-container {
        flex-direction: column;
    }

    .copy-btn {
        align-self: flex-start;
    }

    #videoPlayer {
        max-height: 50vh;
    }

    .embed-size-options {
        flex-direction: column;
        gap: 12px;
    }

    .embed-behavior-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .embed-options {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.7rem;
    }

    .upload-section,
    .result-section,
    .error-section,
    .video-info {
        padding: 20px 15px;
    }

    .file-input-label {
        padding: 15px;
        font-size: 0.9rem;
    }

    .upload-btn {
        padding: 12px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .file-input-label {
        border-color: #000;
    }
    
    .upload-btn:disabled {
        background: #666;
        color: #ccc;
    }
}
