/* ========================================
   Idea To Tech - Custom Styles
   ======================================== */

/* Base Styles */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

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

*::-webkit-scrollbar-track {
    background: #0f172a;
}

*::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Navigation Links */
.nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    background-color: rgba(30, 41, 59, 0.5);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, #4ade80, #86efac, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Card Styles */
.tool-card {
    position: relative;
    display: block;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(30, 41, 59, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
    text-decoration: none;
}

.tool-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    background-color: rgba(15, 23, 42, 0.8);
}

.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(34, 197, 94, 0.06), transparent 40%);
    pointer-events: none;
}

.tool-card:hover::before {
    opacity: 1;
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: white;
    font-weight: 500;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.25);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(to right, #4ade80, #22c55e);
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: white;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #334155;
    border-color: #475569;
}

/* Input Styles */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    color: white;
    transition: all 0.2s;
}

.input-field::placeholder {
    color: #64748b;
}

.input-field:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e;
    outline: none;
}

/* Global input styling - ensure dark background and white text */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    background-color: #1e293b !important; /* dark-800 */
    color: #ffffff !important;
    border-color: #334155 !important; /* dark-700 */
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #22c55e !important; /* brand-500 */
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #64748b !important; /* dark-500 */
}

/* Select dropdown styling */
select option {
    background-color: #1e293b;
    color: #ffffff;
}

/* Textarea for tools */
.tool-textarea {
    width: 100% !important;
    min-height: 16rem;
    padding: 1rem;
    background-color: #0f172a !important; /* dark-900 */
    border: 1px solid #334155 !important; /* dark-700 */
    border-radius: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #f1f5f9 !important; /* dark-100 - light text */
    resize: vertical;
    transition: all 0.2s;
}

.tool-textarea:focus {
    border-color: #22c55e !important; /* brand-500 */
    outline: none;
    box-shadow: 0 0 0 1px #22c55e;
}

.tool-textarea::placeholder {
    color: #64748b !important; /* dark-500 */
}

/* Output area */
.tool-output {
    width: 100%;
    min-height: 16rem;
    max-height: 24rem;
    padding: 1rem;
    background-color: #020617 !important; /* dark-950 */
    border: 1px solid #1e293b !important; /* dark-800 */
    border-radius: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #e2e8f0; /* dark-200 */
    overflow: auto !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    white-space: pre;
    word-wrap: normal;
}

.tool-output.success {
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.tool-output.error {
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #7dd3fc; /* sky-300 */
}

.json-string {
    color: #86efac; /* green-300 */
}

.json-number {
    color: #fcd34d; /* amber-300 */
}

.json-boolean {
    color: #c4b5fd; /* violet-300 */
}

.json-null {
    color: #f87171; /* red-400 */
}

/* TOON Syntax Highlighting */
.toon-key {
    color: #7dd3fc; /* sky-300 */
}

.toon-bracket {
    color: #fcd34d; /* amber-300 */
}

.toon-fields {
    color: #c4b5fd; /* violet-300 */
}

.toon-string {
    color: #86efac; /* green-300 */
}

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

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 40px rgba(34, 197, 94, 0.5); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Hero background pattern */
.hero-pattern {
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(16, 185, 129, 0.1), transparent);
}

/* Grid pattern overlay */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(34, 197, 94, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Tool icon styles */
.tool-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.2));
    color: #4ade80;
    transition: transform 0.3s;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-new {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-popular {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .tool-textarea,
    .tool-output {
        min-height: 12rem;
    }
}
