/* Reset and Base Styles */
* {
    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%, #f472b6 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #f472b6 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* User Info Styles */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Generation Panel */
.generation-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-header h2 {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header i {
    color: #4f46e5;
}

/* Form Styles */
.generation-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #6366f1;
    width: 16px;
}

select, textarea {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

select:focus, textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* Video form textareas - ensure consistent height */
#videoPrompt,
#negativePrompt:not([style*="display: none"]) {
    min-height: 120px !important;
    height: 120px !important;
}

/* Ensure negative prompt is completely hidden when display: none is set */
#negativePrompt[style*="display: none"],
.form-group[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Field help text */
.field-help {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.field-help i {
    color: #4f46e5;
    font-size: 0.75rem;
}

/* Generate Button */
.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #f472b6 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(244, 114, 182, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(244, 114, 182, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Status Panel */
.status-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-content h3 {
    color: #1f2937;
    margin: 20px 0 10px;
    font-size: 1.5rem;
}

.status-content p {
    color: #6b7280;
    margin-bottom: 30px;
}

.loading-spinner {
    display: inline-block;
    font-size: 2rem;
    color: #4f46e5;
}

.loading-spinner.large {
    font-size: 4rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

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

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.section-header h2 {
    font-size: 1.8rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Single image layout - center and maintain aspect ratio */
.image-gallery.single-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
}

/* Single image item - constrain size and maintain aspect ratio */
.image-item.single-image {
    max-width: 400px;
    width: auto;
    height: auto;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Single image - maintain natural aspect ratio */
.image-item.single-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #f8fafc;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

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

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: white;
    transform: scale(1.05);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h3 {
    margin-top: 20px;
    font-size: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        font-size: 1.5rem;
    }

    .generation-panel,
    .status-panel,
    .results-section {
        padding: 20px;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Single image on mobile - smaller max width */
    .image-item.single-image {
        max-width: 300px;
    }
    
    .image-item.single-image img {
        max-height: 400px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    /* Single image on small mobile - even smaller */
    .image-item.single-image {
        max-width: 280px;
    }
    
    .image-item.single-image img {
        max-height: 350px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

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

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Dynamic Fields Styling */
.dynamic-fields {
    margin-top: 15px;
}

.dynamic-field {
    margin-bottom: 15px;
}

.dynamic-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.dynamic-field input,
.dynamic-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.dynamic-field input:focus,
.dynamic-field select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* Reference Image Selection */
.reference-selection {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.reference-selection > label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    font-size: 1rem;
}

.reference-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.reference-option {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reference-option:hover {
    transform: translateY(-2px);
}

.reference-thumbnail {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    position: relative;
    cursor: pointer;
}

.reference-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reference-thumbnail.no-reference {
    flex-direction: column;
    gap: 8px;
    color: #64748b;
    font-weight: 500;
}

.reference-thumbnail.no-reference i {
    font-size: 2rem;
    color: #94a3b8;
}

.reference-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* When radio is checked, style the thumbnail */
.reference-option input[type="radio"]:checked ~ .reference-thumbnail {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.reference-option input[type="radio"]:checked ~ .reference-thumbnail::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4f46e5;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
}

.reference-option label {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: color 0.3s;
    pointer-events: none; /* Prevent double-click issues */
}

.reference-option input[type="radio"]:checked ~ label {
    color: #4f46e5;
    font-weight: 600;
}

/* Make the entire option clickable */
.reference-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
}

@media (max-width: 768px) {
    .reference-options {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .reference-thumbnail {
        height: 100px;
    }
}

/* Gallery Selection Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #f472b6 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

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

.gallery-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;
    font-size: 1.2rem;
    transition: all 0.3s;
}

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

.gallery-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.gallery-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.1);
}

.gallery-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.gallery-image-item.selected {
    border-color: #10b981;
    transform: scale(1.05);
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-image-item:hover .gallery-image-overlay {
    opacity: 1;
}

.gallery-image-selected-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.gallery-image-item.selected .gallery-image-selected-indicator {
    display: flex;
}

.gallery-modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.gallery-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.gallery-modal-btn.primary {
    background: #10b981;
    color: white;
}

.gallery-modal-btn.primary:hover {
    background: #059669;
}

.gallery-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.gallery-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 20px;
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.gallery-empty h4 {
    margin-bottom: 10px;
    color: white;
}

/* Upload Options */
.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.upload-option-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    background: #f8fafc;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.upload-option-btn:hover {
    border-color: #4f46e5;
    background: #f1f5f9;
    color: #4f46e5;
}

.upload-option-btn.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: white;
}

.upload-option-btn i {
    font-size: 1.1rem;
}

/* Scrollbar styling for gallery modal */
.gallery-modal-body::-webkit-scrollbar {
    width: 8px;
}

.gallery-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gallery-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.gallery-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.video-btn.view {
    background: #4f46e5;
    color: white;
}

.video-btn.view:hover {
    background: #4338ca;
}

.video-btn.extend {
    background: #059669;
    color: white;
}

.video-btn.extend:hover {
    background: #047857;
}

/* Animation keyframes for messages */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

/* Validation error styles */
.validation-error {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    margin-top: 8px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    animation: fadeIn 0.3s ease-out !important;
}

.validation-error i {
    color: #dc2626 !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
} 

/* Credit Display Styles */
.user-credits {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.credit-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.credit-item.images {
    color: white;
}

.credit-item.videos {
    color: white;
}

.credit-item i {
    font-size: 0.9rem;
}

/* Credit Warning Styles */
.credit-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.credit-warning i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.credit-warning-text {
    flex: 1;
}

.credit-warning-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.credit-warning-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* Upgrade Popup Styles */
.upgrade-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.upgrade-popup.active {
    display: flex;
}

.upgrade-popup-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease-out;
}

.upgrade-popup-icon {
    background: linear-gradient(135deg, #667eea 0%, #f472b6 100%);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 2rem;
}

.upgrade-popup h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.upgrade-popup p {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.upgrade-popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.upgrade-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upgrade-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #f472b6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upgrade-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.upgrade-btn.secondary {
    background: #f8fafc;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.upgrade-btn.secondary:hover {
    background: #e5e7eb;
}

/* Generate Button Disabled State */
.generate-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.generate-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

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

/* Responsive Credit Display */
@media (max-width: 768px) {
    .user-credits {
        justify-content: flex-start;
        gap: 8px;
    }
    
    .credit-item {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .upgrade-popup-content {
        padding: 30px 20px;
    }
    
    .upgrade-popup-actions {
        flex-direction: column;
    }
    
    .upgrade-btn {
        width: 100%;
        justify-content: center;
    }
}