/* Modern CSS Variables */
:root {
    --bg-main: #000000;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(31, 41, 55, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-green: rgba(16, 185, 129, 0.3);
    --glow-purple: rgba(139, 92, 246, 0.3);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Button Styles */
.btn-primary {
    @apply px-6 py-3 rounded-xl text-white font-semibold transition-all duration-300 transform;
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
    box-shadow: 0 4px 15px var(--glow-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-blue);
    filter: brightness(1.1);
}

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

.btn-success {
    @apply px-6 py-3 rounded-xl text-white font-semibold transition-all duration-300 transform;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    box-shadow: 0 4px 15px var(--glow-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-green);
    filter: brightness(1.1);
}

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

/* File Upload Styles */
.file-upload-container {
    position: relative;
}

.file-upload-area {
    @apply border-2 border-dashed border-gray-600/50 rounded-xl p-8 text-center transition-all duration-300;
    background: rgba(31, 41, 55, 0.3);
    backdrop-filter: blur(10px);
}

.file-upload-area:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.file-upload-area.dragover {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.02);
}

.file-upload-content {
    pointer-events: none;
}

.file-preview {
    @apply mt-4 p-4 rounded-xl border border-gray-600/50;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    max-height: 200px;
    overflow-y: auto;
}

.file-clear-btn {
    @apply mt-2 px-3 py-1 rounded-lg text-sm font-medium transition-all duration-200;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fecaca;
    transform: translateY(-1px);
}

/* Status Indicators */
.status-card {
    @apply flex items-center p-4 rounded-xl transition-all duration-300;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-card:hover {
    background: rgba(31, 41, 55, 0.7);
    transform: translateY(-1px);
}

.status-indicator {
    @apply w-3 h-3 rounded-full mr-3 transition-all duration-300;
    box-shadow: 0 0 10px currentColor;
}

.status-indicator.pending {
    @apply bg-gray-400;
    animation: pulse 2s infinite;
}

.status-indicator.in-progress {
    @apply bg-blue-500;
    animation: pulse 1.5s infinite;
}

.status-indicator.completed {
    @apply bg-green-500;
}

.status-indicator.failed {
    @apply bg-red-500;
}

/* Subtask Cards */
.subtask-card {
    @apply p-6 rounded-xl transition-all duration-300 transform;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.subtask-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.subtask-card.pending {
    border-left: 4px solid #6b7280;
}

.subtask-card.in-progress {
    border-left: 4px solid var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    animation: pulse 2s infinite;
}

.subtask-card.completed {
    border-left: 4px solid var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.subtask-card.failed {
    border-left: 4px solid var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

/* Result Cards */
.result-card {
    @apply p-6 rounded-xl transition-all duration-300;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.result-card pre {
    @apply p-4 rounded-lg overflow-x-auto whitespace-pre-wrap text-sm;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #60a5fa;
    font-weight: 600;
}

.json-string {
    color: #34d399;
}

.json-number {
    color: #fbbf24;
}

.json-boolean {
    color: #a78bfa;
}

.json-null {
    color: #f87171;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

/* Apply animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Toast Notifications */
.toast {
    @apply p-4 rounded-xl shadow-2xl backdrop-blur-sm border transition-all duration-300 transform;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #d1fae5;
}

.toast.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
}

.toast.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #dbeafe;
}

.toast.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fef3c7;
}

.toast.removing {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .file-upload-area {
        padding: 1.5rem;
    }
    
    .subtask-card {
        padding: 1rem;
    }
    
    .result-card {
        padding: 1rem;
    }
}

/* Focus States */
button:focus,
input:focus,
textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--accent-blue);
    ring-opacity: 0.5;
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: white;
}

/* Custom Form Elements */
input[type="file"] {
    cursor: pointer;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px currentColor;
    transition: box-shadow 0.2s ease;
}

/* Utility Classes */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-border {
    position: relative;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    padding: 1px;
    border-radius: 0.75rem;
}

.gradient-border > * {
    background: var(--bg-card);
    border-radius: calc(0.75rem - 1px);
}