/* Global Styles */
* {
    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;
    color: #333;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Auth Styles */
.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #667eea;
}

.logo p {
    color: #666;
    font-size: 0.95rem;
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.switch-form a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* Message Styles */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    background: #f5f5f5;
}

.dashboard-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    color: #667eea;
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.credits-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
}

.credits-value {
    font-size: 1.2rem;
    margin-left: 5px;
}

.user-name {
    font-weight: 600;
    color: #333;
}

/* Main Content */
.dashboard-main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.generation-section,
.history-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.generation-section h2,
.history-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.generate-form {
    max-width: 600px;
}

.cost-preview {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-subtext {
    color: #666;
    margin-top: 10px;
}

/* Result Display */
.result-display {
    text-align: center;
    padding: 30px;
}

.result-display h3 {
    color: #28a745;
    margin-bottom: 20px;
}

.result-display video {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Error Display */
.error-display {
    text-align: center;
    padding: 30px;
}

.error-display h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* Video History */
.video-history {
    display: grid;
    gap: 20px;
}

.video-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s;
}

.video-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-info {
    flex: 1;
}

.video-status {
    margin-bottom: 10px;
}

.badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.video-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.video-details {
    color: #999;
    font-size: 0.85rem;
}

.video-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.history-video {
    max-width: 300px;
    border-radius: 8px;
}

.processing-text {
    color: #856404;
    font-style: italic;
}

.error-text {
    color: #721c24;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .video-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .video-actions {
        width: 100%;
        align-items: center;
        margin-top: 15px;
    }

    .history-video {
        max-width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }
}

