/**
 * Embark Design System Styles
 *
 * This file contains all custom CSS following the gray-html template design system.
 * Before making changes, review:
 * - /gray-html/ - Reference template files
 * - DESIGN_GUIDELINES.md - Complete design documentation
 * - CONTRIBUTING.md - Contribution guidelines
 *
 * Key principles:
 * - Use zinc color palette (zinc-50 through zinc-950)
 * - Follow component patterns from gray-html
 * - Maintain consistent spacing and typography
 */

/* Typography */
.h1 {
    @apply text-5xl font-bold;
}

.h2 {
    @apply text-4xl font-bold;
}

.h3 {
    @apply text-3xl font-bold;
}

.h4 {
    @apply text-2xl font-bold;
}

@media (width >= 768px) {
    .h1 {
        @apply text-6xl;
    }

    .h2 {
        @apply text-5xl;
    }

    .h3 {
        @apply text-4xl;
    }
}

/* Buttons */
.btn,
.btn-sm {
    @apply text-sm font-medium inline-flex items-center justify-center border border-transparent rounded-md tracking-normal transition;
}

.btn {
    @apply px-4 py-2;
}

.btn-sm {
    @apply px-2 py-1;
}

/* Forms */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.form-input,
.form-textarea,
.form-multiselect,
.form-select,
.form-checkbox,
.form-radio {
    @apply border border-zinc-200 shadow-sm focus:ring-0 focus:ring-offset-0;
}

.form-input,
.form-textarea,
.form-multiselect,
.form-select,
.form-checkbox {
    @apply rounded-sm;
}

.form-input,
.form-textarea,
.form-multiselect,
.form-select {
    @apply bg-white text-zinc-600 text-sm px-4 py-2 focus:border-zinc-400;
}

.form-input,
.form-textarea {
    @apply placeholder-zinc-400;
}

.form-select {
    @apply pr-10;
}

.form-checkbox,
.form-radio {
    @apply bg-white checked:bg-zinc-800 checked:border-transparent text-zinc-800 focus-visible:not-checked:border-zinc-400;
}

.form-checkbox {
    @apply rounded-sm;
}

/* Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hamburger button */
.hamburger svg>*:nth-child(1),
.hamburger svg>*:nth-child(2),
.hamburger svg>*:nth-child(3) {
    transform-origin: center;
    transform: rotate(0deg);
}

.hamburger svg>*:nth-child(1) {
    transition: y 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), opacity 0.1s ease-in;
}

.hamburger svg>*:nth-child(2) {
    transition: transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger svg>*:nth-child(3) {
    transition: y 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), width 0.1s 0.25s ease-in;
}

.hamburger.active svg>*:nth-child(1) {
    opacity: 0;
    y: 11;
    transform: rotate(225deg);
    transition: y 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.1s 0.12s ease-out;
}

.hamburger.active svg>*:nth-child(2) {
    transform: rotate(225deg);
    transition: transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.hamburger.active svg>*:nth-child(3) {
    y: 11;
    transform: rotate(135deg);
    transition: y 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1), width 0.1s ease-out;
}

/* Custom styles for code blocks */
.code-block {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.code-block pre {
    margin: 0;
}

.code-block:hover {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-block code {
    color: #e5e7eb;
    font-weight: 500;
}

/* Terminal-like styling for Search Results */
.terminal-container {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    text-align: left;
    padding: 0;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.terminal-container:hover {
    border-color: rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.terminal-header {
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-header::before {
    content: "$ ";
    color: #00ff00;
    opacity: 0.7;
    margin-right: 8px;
}

.terminal-content {
    padding: 16px;
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.7);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 400;
}

.terminal-content:first-of-type {
    flex-grow: 1;
}

.terminal-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-content code {
    color: #00ff41;
    font-family: inherit;
}

/* Terminal cursor effect */
.terminal-final::after {
    content: "█";
    color: #00ff00;
    animation: blink 1s infinite;
    opacity: 0;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Getting Started terminal styling */
.getting-started-terminal pre {
    color: #10b981 !important;
}

.getting-started-terminal code {
    color: #10b981 !important;
    background: transparent !important;
}

/* Landing search UI states */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.searching {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stop-button {
    background: linear-gradient(to right, #ef4444, #dc2626) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.stop-button:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c) !important;
}

/* Terminal input styling */
.terminal-input {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(5, 5, 5, 0.9) 50%,
        rgba(0, 0, 0, 0.87) 100%);
    border: none;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    color: #e0e0e0;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.terminal-input:focus {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(0, 255, 0, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(8, 8, 8, 0.95) 50%,
        rgba(0, 0, 0, 0.92) 100%);
}

.terminal-input::placeholder {
    color: rgba(224, 224, 224, 0.5);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.terminal-input-container {
    position: relative;
}

/* Gray-html enhanced gradient backgrounds */
.card-gradient {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card-gradient:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Shadow utilities matching gray-html */
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}