body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0014 0%, #1a0933 25%, #2d1b69 50%, #1a0933 75%, #0a0014 100%);
    background-size: 400% 400%;
    animation: gradientFlow 20s ease infinite;
    min-height: 100vh;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Particles Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 60%);
    animation: particleMove 30s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(31, 41, 55, 0.5); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, #6366f1 0%, #a855f7 100%); 
    border-radius: 10px; 
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #818cf8 0%, #c084fc 100%); }

/* Modern Card Glassmorphism */
.modern-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(99, 102, 241, 0.1);
    position: relative;
}

.modern-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Input Styling */
.modern-input {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
    transition: all 0.3s ease;
}
.modern-input:focus {
    background: rgba(30, 41, 59, 1);
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}
.modern-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Button Gradient */
.gradient-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    background-size: 200% 200%;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}
.gradient-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.gradient-btn:hover::before {
    transform: translateX(100%);
}
.gradient-btn:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.6);
}
.gradient-btn:active { 
    transform: translateY(0); 
}
.gradient-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Settings Button */
.settings-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}
.settings-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}
.animate-fade-in { 
    animation: fadeIn 0.6s ease-out forwards; 
}

@keyframes slideDown { 
    from { opacity: 0; max-height: 0; } 
    to { opacity: 1; max-height: 100px; } 
}
.slide-down { 
    animation: slideDown 0.3s ease-out forwards; 
}

/* Idea Chip */
.idea-chip {
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(55, 65, 81, 0.5);
    color: #c7d2fe;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.idea-chip:hover {
    transform: scale(1.05) translateY(-2px);
    background: rgba(99, 102, 241, 0.4);
    border-color: #818cf8;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Inspiration Box */
.inspiration-box {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Slider Container */
.slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(31, 41, 55, 0.5);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(55, 65, 81, 1);
}

/* Output Buttons */
.output-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: rgba(55, 65, 81, 1);
    color: #e5e7eb;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid rgba(75, 85, 99, 1);
}
.output-btn:hover {
    background: rgba(75, 85, 99, 1);
    transform: translateY(-1px);
}
.output-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.output-btn-danger {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.output-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Prose Styling */
.prose p { margin-bottom: 1em; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { 
    color: #a5b4fc; 
    margin-top: 1.5em; 
    margin-bottom: 0.5em; 
    font-weight: 700; 
}
.prose ul { 
    list-style-type: disc; 
    padding-left: 1.5em; 
    margin-bottom: 1em; 
}
.prose strong { 
    color: #e0e7ff; 
    font-weight: 600;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

/* Confirm Delete Modal - Higher z-index */
#confirm-delete-modal {
    z-index: 1100;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
}

#confirm-delete-modal .modal-container {
    max-width: 450px;
    animation: confirmModalPop 0.3s ease-out;
}

@keyframes confirmModalPop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-overlay.hidden {
    display: none;
}

.modal-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(99, 102, 241, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.05);
}
.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.25rem;
}
.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* API Input Section */
.api-input-section {
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 1.5rem;
}

/* API Keys List */
.api-keys-list {
    margin-bottom: 1.5rem;
}

.api-key-item {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}
.api-key-item:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.api-key-display {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-key-actions {
    display: flex;
    gap: 0.5rem;
}

.api-key-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-check {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}
.btn-check:hover {
    background: rgba(59, 130, 246, 0.2);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-valid {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-invalid {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-limit {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-checking {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Rotation Settings */
.rotation-settings {
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(75, 85, 99, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 28px;
    transition: all 0.3s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}
input:checked + .toggle-slider {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}
input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        max-width: calc(100% - 2rem);
    }
    .modern-card {
        padding: 1rem;
    }
}
