/* Import Inter font for modern typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Professional 3-Color Palette */
    --primary: #2563eb;        /* Blue-600 - Main brand color */
    --primary-hover: #1d4ed8;  /* Blue-700 - Hover states */
    --primary-light: #dbeafe; /* Blue-100 - Light backgrounds */
    
    --secondary: #475569;      /* Slate-600 - Text & secondary elements */
    --secondary-hover: #334155; /* Slate-700 - Hover states */
    --secondary-light: #f1f5f9; /* Slate-100 - Light backgrounds */
    
    --accent: #7c3aed;         /* Violet-600 - Highlights & success */
    --accent-hover: #6d28d9;   /* Violet-700 - Hover states */
    --accent-light: #ede9fe;   /* Violet-100 - Light backgrounds */
    
    --success: #10b981;        /* Emerald-500 - Success states */
    --success-hover: #059669;  /* Emerald-600 - Hover states */
    --success-light: #d1fae5;  /* Emerald-100 - Light backgrounds */
    
    --info: #0ea5e9;           /* Sky-500 - Info states */
    --info-hover: #0284c7;     /* Sky-600 - Hover states */
    --info-light: #e0f2fe;     /* Sky-100 - Light backgrounds */
    
    /* Neutral colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Animated background elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(71, 85, 105, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Container background overlay */
.container {
    position: relative;
    z-index: 1;
}

.gradient-text {
    color: #ffffff;
    position: relative;
    display: inline-block;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

/* Header styling */
.header-container {
    position: relative;
    z-index: 2;
}

.header-title {
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-subtitle {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 24px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.main-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(37, 99, 235, 0.2); /* Blue border */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

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

.main-card:hover::before {
    left: 100%;
}

.main-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.7);
    border-color: rgba(37, 99, 235, 0.4);
}

.file-drop-area {
    border: 2px dashed #94a3b8; /* border-slate-400 */
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.file-drop-area.dragover {
    border-color: #4f46e5; /* border-indigo-600 */
    background-color: #e0e7ff; /* bg-indigo-100 */
}

.file-drop-area.file-uploaded {
    background: rgba(209, 250, 229, 0.9) !important; /* Success green background */
    border-color: rgba(16, 185, 129, 0.6) !important; /* Success green border */
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.file-drop-area.file-uploaded:hover {
    background: rgba(209, 250, 229, 0.95) !important;
    border-color: rgba(16, 185, 129, 0.8) !important;
    transform: translateY(-2px);
}

#output-section, #loading-section {
    display: none;
}

/* Professional Output Container */
#output-container {
    background: rgba(248, 250, 252, 0.9) !important;
    backdrop-filter: blur(15px) !important;
    border: 2px solid rgba(124, 58, 237, 0.2) !important; /* Violet border */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
    position: relative;
    overflow: hidden;
}

#output-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed); /* Violet-Blue gradient */
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

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

#output-content {
    position: relative;
    z-index: 1;
}

.prompt-container {
    background-color: var(--secondary-light); /* bg-slate-100 */
    border-left: 4px solid var(--primary); /* border-blue-600 */
    border-radius: 0.5rem;
}

/* Enhanced buttons - Task2MTP Style */
.btn-primary, button[class*="bg-"], .copy-button, #generate-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}



.btn-primary::before, button[class*="bg-"]::before, .copy-button::before, #generate-button::before, #instructions-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;
}

.btn-primary:hover::before, button[class*="bg-"]:hover::before, .copy-button:hover::before, #generate-button:hover::before, #instructions-button:hover::before {
    left: 100%;
}

.btn-primary:hover, button[class*="bg-"]:hover, .copy-button:hover, #generate-button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4) !important;
}



/* ========== API KEY BUTTON - 2 STATES ONLY ========== */

/* Base API Key Button Styling */
#api-key-button {
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    border-radius: 9999px !important; /* rounded-full */
}

/* State 1: NOT CONFIGURED - Orange Warning */
#api-key-button.api-not-configured {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%) !important;
    border: 2px solid rgba(251, 146, 60, 0.7) !important;
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.4) !important;
}

#api-key-button.api-not-configured::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

#api-key-button.api-not-configured:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border-color: rgba(251, 146, 60, 0.9) !important;
    box-shadow: 0 8px 25px rgba(251, 146, 60, 0.5) !important;
    transform: translateY(-2px) !important;
}

#api-key-button.api-not-configured:hover::before {
    left: 100%;
}

/* State 2: CONFIGURED - Green Success */
#api-key-button.api-configured {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 2px solid rgba(16, 185, 129, 0.7) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
}

#api-key-button.api-configured::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

#api-key-button.api-configured:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border-color: rgba(16, 185, 129, 0.9) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-2px) !important;
}

#api-key-button.api-configured:hover::before {
    left: 100%;
}

/* ========== INSTRUCTIONS BUTTON ========== */
#instructions-button {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    border-radius: 9999px !important; /* rounded-full */
}

#instructions-button:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
}

.btn-primary:disabled, button[class*="bg-"]:disabled, #generate-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Professional Action Buttons - 3 Color Palette */

/* Copy button - Success Green */
#copy-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

#copy-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4) !important;
}

/* Tips button - Amber Warning */
#tips-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

#tips-button:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4) !important;
}

/* Restart button - Info Sky Blue */
#restart-button {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

#restart-button:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4) !important;
}

/* Main generate button - Blue Primary (Strong) */
#generate-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
}

#generate-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4) !important;
}

/* Professional Form Elements */
textarea, input, select {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(100, 116, 139, 0.2) !important; /* Slate border */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s ease !important;
}

textarea:focus, input:focus, select:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(37, 99, 235, 0.6) !important; /* Blue focus */
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px);
}

/* Professional Section Titles - 3 Color Palette */
.section-title {
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    font-weight: 700;
}

/* Setup section - Blue (Primary) */
.setup-title {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setup-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Results section - Success Green */
.results-title {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.results-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Additional title variations */
.info-title {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.accent-title {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* Headers */
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 2px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-message {
    display: none;
    background-color: #c53030;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}

/* Basic styling for rendered markdown content */
#output-content h1, #output-content h2, #output-content h3 {
    font-weight: 600;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    color: #1e293b; /* text-slate-800 */
}

#output-content h1 { font-size: 1.5rem; }
#output-content h2 { font-size: 1.25rem; }
#output-content h3 { font-size: 1.1rem; }
#output-content p { margin-bottom: 1em; line-height: 1.6; }
#output-content ul { list-style-position: inside; margin-left: 1.5em; margin-bottom: 1em; }
#output-content li { margin-bottom: 0.5em; }

#output-content code {
    background-color: #e2e8f0; /* bg-slate-200 */
    color: #1e293b; /* text-slate-800 */
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

#output-content pre {
    background-color: #0f172a; /* bg-slate-900 */
    color: #e2e8f0; /* text-slate-200 */
    padding: 1em;
    border-radius: 8px;
    margin-bottom: 1em;
    white-space: pre-wrap;
    word-break: break-word;
}

#output-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* API Key status styling */
.api-key-valid {
    color: #059669; /* text-green-600 */
}

.api-key-invalid {
    color: #dc2626; /* text-red-600 */
}

.api-key-warning {
    color: #d97706; /* text-amber-600 */
}

/* Modal improvements */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Ensure buttons are touch-friendly */
    button, .copy-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better text readability on mobile */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Optimize file drop area for mobile */
    .file-drop-area {
        min-height: 120px;
    }
    
    /* Ensure modals don't overflow on small screens */
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
}

/* Top action buttons styling */
.guide-button {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    border: 2px solid rgba(37, 99, 235, 0.6) !important;
    color: #1e40af !important;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

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

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

.guide-button:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(37, 99, 235, 0.8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3) !important;
    color: #1e40af !important;
    text-decoration: none;
}

/* Ensure no underline for all guide buttons */
.guide-button, .guide-button:hover, .guide-button:focus, .guide-button:visited {
    text-decoration: none !important;
}

/* Footer styling */
footer {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(15px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 2rem;
}

footer a {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

footer a:hover {
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ========== MODE SELECTOR STYLING ========== */

.mode-selector-container {
    position: relative;
    z-index: 2;
}

.mode-selector {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.mode-btn {
    color: #64748b;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.mode-btn:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mode-btn.active::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;
}

.mode-btn.active:hover::before {
    left: 100%;
}

.mode-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ========== TEXT MODE STYLING ========== */

#input-section {
    animation: fadeIn 0.5s ease-in-out;
}

/* ========== IMAGE ANALYSIS STYLING ========== */

#image-input-section {
    animation: fadeIn 0.5s ease-in-out;
}

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

#image-drop-area {
    transition: all 0.3s ease;
}

#image-drop-area.dragover {
    border-color: #7c3aed;
    background-color: #f3e8ff;
    transform: scale(1.02);
}

#image-drop-area.image-uploaded {
    background: rgba(236, 254, 255, 0.9) !important;
    border-color: rgba(14, 165, 233, 0.6) !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2) !important;
}

#image-drop-area.image-uploaded:hover {
    background: rgba(236, 254, 255, 0.95) !important;
    border-color: rgba(14, 165, 233, 0.8) !important;
    transform: translateY(-2px);
}

/* Image Preview Styling */
#image-preview-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

#image-preview {
    transition: all 0.3s ease;
    border: 2px solid rgba(14, 165, 233, 0.2);
}

#image-preview:hover {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.2);
    transform: scale(1.02);
}

#remove-image {
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

#remove-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Analyze Image Button - Info Blue Style */
#analyze-image-button {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

#analyze-image-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;
}

#analyze-image-button:hover::before {
    left: 100%;
}

#analyze-image-button:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4) !important;
}

#analyze-image-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Hide/Show sections based on mode */
body.text-mode #input-section {
    display: block;
}

body.text-mode #image-input-section,
body.text-mode #cooking-input-section {
    display: none;
}

body.image-mode #image-input-section {
    display: block;
}

body.image-mode #input-section,
body.image-mode #cooking-input-section {
    display: none;
}

body.cooking-mode #cooking-input-section {
    display: block;
}

body.cooking-mode #input-section,
body.cooking-mode #image-input-section {
    display: none;
}

/* Force hide sections when they have inline style display: none */
#input-section[style*="display: none"],
#image-input-section[style*="display: none"],
#cooking-input-section[style*="display: none"] {
    display: none !important;
}

#input-section[style*="display:none"],
#image-input-section[style*="display:none"],
#cooking-input-section[style*="display:none"] {
    display: none !important;
}

/* ========== COOKING MODE STYLING ========== */

#cooking-input-section {
    animation: fadeIn 0.5s ease-in-out;
}

/* Cooking Steps */
.cooking-step {
    position: relative;
    margin-bottom: 2rem;
}

.cooking-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Requirements Grid */
.requirements-grid label {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.requirements-grid label:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.requirements-grid input:checked + span {
    color: #1e40af !important;
    font-weight: 600;
}

.requirements-grid label:has(input:checked) {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Cook Button - Special Gradient */
#cook-prompt-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4) !important;
}

#cook-prompt-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;
}

#cook-prompt-button:hover::before {
    left: 100%;
}

#cook-prompt-button:hover {
    background: linear-gradient(135deg, #ea580c 0%, #b91c1c 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(249, 115, 22, 0.5) !important;
}

#cook-prompt-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Cooking Animation */
@keyframes cooking {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
    75% { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
}

#cook-prompt-button:not(:disabled):hover svg {
    animation: cooking 0.6s ease-in-out;
}

/* Landscape mobile optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    header {
        margin-bottom: 1.5rem;
    }
    
    .mode-selector-container {
        margin-bottom: 1rem;
    }
}

/* Mobile optimizations for mode selector */
@media (max-width: 640px) {
    .mode-btn span {
        font-size: 0.875rem;
    }
    
    .mode-btn svg {
        width: 1rem;
        height: 1rem;
    }
    
    .mode-btn {
        padding: 0.75rem 1rem;
    }
    
    #image-preview {
        max-height: 200px;
    }
}
