* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: white;
}

header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.logo h1 {
    font-size: 1.8rem;
    background: linear-gradient(to right, #ffffff, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: 1px solid rgba(236, 72, 153, 0.5);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

.header-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
    background: linear-gradient(135deg, #db2777, #7c3aed);
}

.header-back-btn:active {
    transform: translateY(0);
}

.header-back-btn span:first-child {
    font-size: 1.2rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(0.95);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-in;
    padding: 2rem 0;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    color: #cbd5e1;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(236, 72, 153, 0.4);
    border-color: rgba(236, 72, 153, 0.5);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 28px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
}

.feature-card p {
    color: #cbd5e1;
    line-height: 1.7;
    font-size: 1rem;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(236, 72, 153, 0.3);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.5);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.5);
}

.mode-icon {
    font-size: 1.5rem;
}

.video-generator {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-in;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.generation-section {
    display: none;
}

.generation-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.video-generator h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 1rem;
}

.input-group textarea,
.input-group select,
.input-group input[type="file"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group textarea::placeholder {
    color: #64748b;
}

.input-group textarea:focus,
.input-group select:focus,
.input-group input[type="file"]:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.input-group select {
    cursor: pointer;
}

/* Image Upload Styles */
.image-upload-container {
    position: relative;
}

.input-group input[type="file"] {
    display: none;
}

.upload-preview {
    width: 100%;
    min-height: 300px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px dashed rgba(236, 72, 153, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-preview:hover {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #cbd5e1;
    text-align: center;
    padding: 2rem;
}

.upload-icon {
    font-size: 4rem;
}

.upload-placeholder p {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.upload-hint {
    font-size: 0.9rem;
    color: #94a3b8;
}

.upload-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.remove-image:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    margin-top: 1rem;
    width: 100%;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

.btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.result-box {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 12px;
    padding: 0;
    margin-top: 2rem;
    display: none;
    animation: fadeIn 0.5s ease-in;
    overflow: hidden;
}

.result-box.show {
    display: block;
}

.result-header {
    background: rgba(236, 72, 153, 0.1);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(236, 72, 153, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-header h4 {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0;
}

.result-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.meta-badge {
    background: rgba(236, 72, 153, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.result-content {
    padding: 2rem;
}

.image-preview-result {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 4px solid #8b5cf6;
    border-radius: 8px;
}

.image-preview-result strong {
    display: block;
    margin-bottom: 1rem;
    color: #8b5cf6;
    font-size: 1.1rem;
}

.image-preview-result img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.prompt-display {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(236, 72, 153, 0.05);
    border-left: 4px solid #ec4899;
    border-radius: 8px;
}

.prompt-display strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #ec4899;
    font-size: 1.1rem;
}

.prompt-display p {
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

.ai-response {
    margin-top: 1.5rem;
}

.ai-response strong {
    display: block;
    margin-bottom: 1rem;
    color: #8b5cf6;
    font-size: 1.1rem;
}

.ai-response pre {
    background: rgba(15, 23, 42, 0.9);
    padding: 1.5rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    border: 1px solid rgba(139, 92, 246, 0.3);
    margin: 0;
}

.copy-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #ec4899;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(236, 72, 153, 0.2);
    border-top-color: #ec4899;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    display: none;
    animation: shake 0.5s ease-in-out;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error.show {
    display: block;
}

/* Examples Section */
.examples-section {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.examples-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
    font-weight: 600;
}

.example-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.example-btn {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.4);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
}

.example-btn:hover {
    background: rgba(236, 72, 153, 0.3);
    border-color: rgba(236, 72, 153, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.example-btn:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
    border-top: 1px solid rgba(236, 72, 153, 0.2);
    margin-top: 4rem;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .header-back-btn {
        width: 100%;
        justify-content: center;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 2rem 1rem;
    }

    .video-generator {
        padding: 2rem 1.5rem;
    }

    .video-generator h3 {
        font-size: 1.5rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .example-buttons {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        flex-direction: column;
        width: 100%;
    }

    .mode-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.75rem;
    }

    .feature-card {
        padding: 2rem;
    }

    .video-generator, .examples-section {
        padding: 1.5rem 1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #db2777, #7c3aed);
}

/* Selection styling */
::selection {
    background: rgba(236, 72, 153, 0.3);
    color: white;
}

/* Back to Home Button */
.back-to-home-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: 2px solid rgba(236, 72, 153, 0.5);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.back-to-home-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-home-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.6);
    background: linear-gradient(135deg, #db2777, #7c3aed);
}

.back-to-home-btn:active {
    transform: translateY(-2px);
}

.back-to-home-btn span {
    display: block;
    line-height: 1;
}

a{
    text-decoration: none;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}