* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #0f0f1e;
    color: white;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(239, 71, 111, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 78, 142, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(78, 158, 255, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

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

.brand-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ef476f 0%, #ff8fab 50%, #4e9eff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-top: 8px;
    font-weight: 400;
}

/* Main Card */
.main-card {
    background: rgba(20, 20, 35, 0.6);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.6s ease 0.2s both;
}

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

h2 {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 40px 0 30px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider-text {
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: lowercase;
}

.drop-zone {
    border: 3px dashed #4e4e8e;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(43, 46, 74, 0.5) 0%, rgba(78, 78, 142, 0.1) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 71, 111, 0.1), transparent);
    transition: left 0.5s;
}

.drop-zone:hover {
    border-color: #ef476f;
    background: linear-gradient(135deg, rgba(78, 78, 142, 0.2) 0%, rgba(239, 71, 111, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 71, 111, 0.2);
}

.drop-zone:hover::before {
    left: 100%;
}

.drop-zone--over {
    border-color: #ff8fab;
    background: rgba(239, 71, 111, 0.15);
    transform: scale(1.02);
}

.dropbox-container {
    margin-top: 20px;
    text-align: center;
}

.dropbox-url {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dropbox-url:focus {
    outline: none;
    border-color: #ef476f;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.1);
}

.dropbox-url::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.generate-button {
    background: linear-gradient(135deg, #ef476f 0%, #ff6392 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.3);
    position: relative;
    overflow: hidden;
}

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

.generate-button:hover {
    background: linear-gradient(135deg, #ff6392 0%, #ff8fab 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 71, 111, 0.5);
}

.generate-button:hover::before {
    left: 100%;
}

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

.drop-zone__prompt {
    color: #b0b0d0;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.drop-zone__input {
    display: none;
}

.progress-container {
    margin-bottom: 20px;
}

.upload-button {
    background: linear-gradient(135deg, #ef476f 0%, #ff6392 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.3);
    width: 100%;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

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

.upload-button:hover {
    background: linear-gradient(135deg, #ff6392 0%, #ff8fab 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 71, 111, 0.5);
}

.upload-button:hover::before {
    left: 100%;
}

.upload-button:active {
    transform: translateY(0);
}

.upload-button:disabled {
    background: linear-gradient(135deg, #4e4e8e 0%, #6e6e9e 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.upload-button:disabled:hover {
    transform: none;
}

.image-preview {
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 15px;
    margin-top: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.image-preview img:hover {
    transform: scale(1.05);
}
.textarea-container {
    margin-top: 30px;
    padding: 0;
    position: relative;
    display: none;
    animation: slideUp 0.4s ease;
}

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

.textarea-container h3 {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.textarea-container textarea {
    width: 100%;
    height: 110px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.textarea-container textarea:focus {
    outline: none;
    border-color: #ef476f;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.1);
}

.textarea-container::after {
    position: absolute;
    top: -1.5em;
    left: 10px;
    font-size: 0.8rem;
    color: #9090c0;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.footer p {
    margin: 0;
}

.admin-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-left: 5px;
}

.admin-link:hover {
    color: #ef476f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2rem;
    }

    .brand-icon {
        font-size: 3rem;
    }

    .main-card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .tab-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 6px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .page-wrapper {
        padding: 20px 15px;
    }

    .image-preview img {
        max-width: 200px;
        max-height: 200px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ef476f;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    padding: 16px 24px;
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1), fadeOut 0.3s ease 2.7s;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid #ef476f;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Copy Button */
.copy-button {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.95rem;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.copy-button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.05);
}

/* Tab System */
.tab-container {
    margin-top: 0;
}

.tab-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-button {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.tab-button:hover .tab-icon {
    transform: scale(1.1);
}

.tab-button.active {
    background: linear-gradient(135deg, #ef476f 0%, #ff6392 100%);
    color: white;
    box-shadow:
        0 4px 12px rgba(239, 71, 111, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-button.active .tab-icon {
    transform: scale(1.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}