/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.container {
    margin: 10px auto;
    padding: 2rem;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    color: #2d3748;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 2.2rem;
    font-weight: 900;
    text-shadow: none;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    background-color: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation styles */
.main-nav {
    margin-top: 1.5rem;
    text-align: center;
}

.nav-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.shell-var {
    background: rgba(255, 255, 255, 0.2);
    color: #a855f7;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
}

/* Main layout */
.main-layout {
    display: flex;
    flex-direction: column;
    /* gap: 1.5rem; */
    margin: 0 auto;
    transition: all 0.5s ease;
    max-width: 100%;
    overflow: hidden;
}

/* Top prompt (always visible above panels) */
.top-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
}

.top-form {
    max-width: 600px;
    width: 100%;
}

/* Panels container */
.panels-container {
    display: flex;
    gap: 1.5rem;
    transition: all 0.5s ease;
}

/* Panel base styles */
.left-panel {
    flex: 0 0 8%;
    min-width: 180px;
    max-width: 200px;
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 200px;
    padding: 1rem;
}

.middle-panel {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 200px;
    padding: 1rem;
}

.right-panel {
    flex: 0 0 25%;
    min-width: 200px;
    max-width: 300px;
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 200px;
    padding: 1rem;
}

.panel-header {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.panel-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

/* Form styles */
.palette-form {
    background: transparent;
    padding: 0;
    /* margin-bottom: 2rem; */
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.typing-demo {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
    pointer-events: none;
    z-index: 1;
}

.typing-cursor {
    color: #667eea;
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    /* border: 1px solid rgb(0 0 0 / 96%); */
    border-radius: 0;
    font-size: 1.1rem;
    background: rgb(255 255 255);
    color: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-bottom-color: #667eea;
    background: rgb(255 255 255);
}

.input-group input:focus ~ .typing-demo,
.input-group input:not(:placeholder-shown) ~ .typing-demo {
    display: none;
}

.cursor-blink {
    position: absolute;
    right: 1.5rem;
    color: #667eea;
    font-size: 1.1rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-group input:focus + .cursor-blink {
    opacity: 1;
    animation: blink 1s infinite;
}

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

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
}

.input-group textarea {
    min-height: 80px;
    line-height: 1.4;
}

/* Button styles */
button {
    width: auto;
    padding: 0.875rem 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: inline-block;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Error message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fcc;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive design handled in mobile.css */

/* Footer styles */
.main-footer {
    margin-top: 3rem;
    padding: 1rem 0;
    text-align: center;
}

.main-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
}

.main-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.main-footer a:hover {
    text-decoration: underline;
}

.main-footer code {
    background: #f1f5f9;
    color: #e53e3e;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
}

.ai-disclaimer {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
    font-style: italic;
}

.ai-disclaimer small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #a16207;
    font-style: normal;
}

.ai-disclaimer small code {
    background: rgba(161, 98, 7, 0.1);
    color: #92400e;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.tech-brag {
    margin-top: 0.5rem !important;
    font-size: 0.85rem;
    color: #718096;
    font-style: italic;
}

/* Language selector styles */
.language-selector-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

.language-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-select:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #9ca3af;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.code-preview {
    position: relative;
}

/* Loading spinner styles */
.loading-spinner {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}