/* style.css – AI Study Helper – Two-column fixed layout (left input, right output) */

:root {
    --ash-glass-bg: rgba(255, 255, 255, 0.25);
    --ash-glass-border: rgba(255, 255, 255, 0.4);
    --ash-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --ash-primary: #4f46e5;
    --ash-primary-light: #6366f1;
    --ash-accent: #f97316;
    --ash-text-dark: #1e1e2f;
    --ash-text-light: #f8fafc;
    --ash-bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    --ash-card-radius: 24px;
    --ash-btn-radius: 40px;
}

.ash-app-wrapper *,
.ash-app-wrapper *::before,
.ash-app-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ash-app-wrapper {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ash-bg-gradient);
    min-height: 100vh;
    padding: 20px 16px;
    color: var(--ash-text-dark);
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fixed container */
.ash-app-container {
    max-width: 1200px;
    width: 100%;
    height: 900px; /* Adjust between 800-1000px as needed */
    display: flex;
    flex-direction: column;
}

/* Two-column grid - this ensures side-by-side layout */
.ash-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0; /* Important for height containment */
}

/* Glassmorphism card */
.glass-card {
    background: var(--ash-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ash-glass-border);
    border-radius: var(--ash-card-radius);
    box-shadow: var(--ash-glass-shadow);
    padding: 24px 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Left panel */
.ash-left-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Urdu instructions */
.ash-urdu-instructions {
    background: rgba(79, 70, 229, 0.15);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ash-primary);
    border-right: 4px solid var(--ash-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(4px);
    direction: rtl;
    text-align: right;
    flex-shrink: 0;
}

.ash-urdu-instructions i {
    font-size: 1.3rem;
    color: var(--ash-primary);
}

/* Textarea */
.ash-textarea-wrapper {
    position: relative;
    margin-bottom: 16px;
    flex-shrink: 0;
}

#ash-inputText {
    width: 100%;
    height: 200px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    font-size: 1rem;
    resize: vertical;
    color: var(--ash-text-dark);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
    transition: border 0.2s;
}

#ash-inputText:focus {
    outline: none;
    border-color: var(--ash-primary);
    background: rgba(255,255,255,0.5);
}

.ash-char-counter {
    text-align: right;
    font-size: 0.8rem;
    margin-top: 6px;
    opacity: 0.7;
}

/* File actions */
.ash-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.ash-btn {
    padding: 10px 18px;
    border-radius: var(--ash-btn-radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    background: white;
    color: var(--ash-primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.8);
}

.ash-btn-outline {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
}

.ash-btn:hover {
    background: var(--ash-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.ash-btn:active {
    transform: translateY(0);
}

/* Action grid */
.ash-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex-shrink: 0;
    margin-top: auto;
}

.ash-action-btn {
    background: var(--ash-primary);
    color: white;
    border: none;
    padding: 14px 8px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
    transition: 0.15s;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
}

.ash-action-btn i {
    font-size: 1.1rem;
}

.ash-action-btn:hover {
    background: #3730a3;
    transform: scale(0.98);
}

/* Right panel */
.ash-right-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ash-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.ash-output-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ash-primary);
}

.ash-icon-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--ash-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ash-icon-btn:hover {
    background: rgba(255,255,255,0.5);
}

/* Result content */
.ash-result-content {
    background: rgba(255,255,255,0.3);
    border-radius: 18px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
}

.ash-placeholder-text {
    opacity: 0.6;
    text-align: center;
    margin-top: 40px;
}

/* Loading overlay */
.ash-loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 12px;
    flex: 1;
}

.ash-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--ash-primary);
    animation: ash-spin 1s linear infinite;
}

@keyframes ash-spin {
    to { transform: rotate(360deg); }
}

/* Progress message */
.ash-progress-message {
    background: rgba(255,255,240,0.7);
    padding: 10px 16px;
    border-radius: 30px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    border-left: 4px solid var(--ash-accent);
    flex-shrink: 0;
}

/* Footer */
.ash-footer-note {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.8;
    padding: 12px 0 0;
    flex-shrink: 0;
}

/* Responsive: stack on mobile */
@media (max-width: 900px) {
    .ash-app-wrapper {
        align-items: flex-start;
    }
    
    .ash-app-container {
        height: auto;
    }
    
    .ash-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ash-left-panel,
    .ash-right-panel {
        height: auto;
        min-height: 500px;
    }
    
    #ash-inputText {
        height: 180px;
    }
}

@media (max-height: 800px) {
    .ash-app-container {
        height: auto;
    }
}