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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e5e7eb;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Main content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Model section at top */
.model-section-top {
    background: #1f2937;
    border-radius: 16px;
    padding: 10px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #374151;
}

.model-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.model-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.temperature-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.temperature-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.temperature-info-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon-small {
    width: 18px;
    height: 18px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-icon-small:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.tooltip-temperature {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 250px;
}

.tooltip-temperature::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

.temperature-info-icon:hover .tooltip-temperature {
    opacity: 1;
    visibility: visible;
}

.tooltip-temperature p {
    margin-bottom: 8px;
    font-weight: 500;
}

.tooltip-temperature ul {
    margin: 0;
    padding-left: 16px;
}

.tooltip-temperature li {
    margin-bottom: 4px;
}

/* Model info icon and tooltip */
.model-info-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px; /* Align with the dropdown box */
}

.info-icon {
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

.model-info-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip-text {
    margin-bottom: 8px;
}

.tooltip-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.tooltip-link:hover {
    text-decoration: underline;
}

/* Content area */
.content-area {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
    flex: 1;
    min-height: 0; /* Allow proper scrolling */
}

/* Chat section */
.chat-section {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow proper scrolling */
}

.chat-container {
    background: #1f2937;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px); /* Increased height */
    min-height: 300px;
    border: 1px solid #374151;
}

.chat-header {
    padding: 8px 15px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header h3 {
    color: #e5e7eb;
    font-weight: 600;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.response-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.input-area {
    border-top: 1px solid #374151;
    padding: 10px;
    flex-shrink: 0;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.model-select {
    padding: 12px 16px;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    background: #374151;
    color: #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.model-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}



.prompt-input {
    padding: 8px;
    border: 2px solid #374151;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    max-height: 70px;
    transition: all 0.2s ease;
    background: #374151;
    color: #e5e7eb;
}

.prompt-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.temperature-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.temperature-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #374151;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.temperature-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.temperature-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}



.button-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border: 2px solid #4b5563;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Output section */


.output-status {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-light.yellow {
    background-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.status-light.green {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.response-area {
    padding: 10px;
    overflow-y: auto;
}

.output-display {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 315px;
    max-height: 515px;
    overflow-y: auto;
}



.output-display:empty::before {
    content: "Response will appear here...";
    color: #6b7280;
    font-style: italic;
}

/* History section */
.history-section {
    background: #1f2937;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px);
    min-height: 300px;
    border: 1px solid #374151;
}

.history-header {
    padding: 8px 15px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    color: #e5e7eb;
    font-weight: 600;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

.history-container {
    flex: 1;
    padding: 12px 15px;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.history-item:hover {
    background: #1f2937;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.history-item-text {
    color: #e5e7eb;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.history-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.btn-icon {
    padding: 4px;
    font-size: 0.7rem;
    min-width: auto;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid #374151;
    color: #e5e7eb;
}

.history-empty {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 15px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Mobile message */
.mobile-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #1f2937;
    padding: 50px 20px;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-message h2 {
    color: #e5e7eb;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.mobile-message p {
    color: #9ca3af;
    font-size: 1rem;
}



/* Responsive design */
@media (max-width: 768px) {
    .mobile-message {
        display: flex;
    }
    
    .desktop-content {
        display: none;
    }
    
    .content-area {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .model-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .temperature-group {
        min-width: auto;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .model-section-top, .input-area {
        padding: 12px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .chat-container, .history-section {
        height: calc(100vh - 260px);
    }
    
    .tooltip {
        white-space: normal;
        max-width: 250px;
    }
}



/* Success/Error states */
.status-success {
    color: #059669;
}

.status-error {
    color: #dc2626;
}

.status-info {
    color: #2563eb;
} 