/* Settings page custom styles */

/* Radio button styling */
input[type="radio"]:checked + div {
    color: #2563eb;
}

input[type="radio"]:checked {
    color: #2563eb;
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Provider cards */
input[type="radio"]:checked + div {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #2563eb;
}

label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-color: #2563eb !important;
    border-width: 2px !important;
}

/* Form styling */
input[type="url"], 
input[type="password"], 
input[type="text"],
select {
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button animations */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    transform: none;
    box-shadow: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status indicators */
.status-connected {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.status-error {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.status-testing {
    background-color: #f59e0b;
    animation: pulse 2s infinite;
}

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

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status message */
#statusMessage {
    z-index: 1000;
    min-width: 200px;
    animation: slideInUp 0.3s ease-out;
}

#statusMessage.success {
    background-color: #10b981;
    color: white;
}

#statusMessage.error {
    background-color: #ef4444;
    color: white;
}

#statusMessage.info {
    background-color: #3b82f6;
    color: white;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* File input styling */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    cursor: pointer;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

/* Model select styling */
#model {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Toggle button for password visibility */
.password-toggle {
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #2563eb;
}

/* Storage info styling */
#storageInfo div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Progress bars */
.storage-progress {
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.storage-progress-bar {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.storage-progress-bar.warning {
    background-color: #f59e0b;
}

.storage-progress-bar.danger {
    background-color: #ef4444;
}

/* Responsive design */
@media (max-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .lg\\:col-span-2 {
        grid-column: span 1;
    }
    
    .max-w-4xl {
        max-width: 100%;
    }
    
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Card hover effects */
.bg-white {
    transition: box-shadow 0.2s ease;
}

.bg-white:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Input validation states */
input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

/* Tooltip styling */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Animation for form sections */
.form-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Collapsible card styles */
.collapsible-card {
    transition: all 0.3s ease;
}

.collapsible-header {
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background-color: #f9fafb;
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.collapse-icon.rotated {
    transform: rotate(180deg);
}

/* Special handling for collapsed state border */
.collapsible-card .collapsible-header {
    border-bottom: 1px solid #e5e7eb;
}

.collapsible-card:has(.collapsible-content.collapsed) .collapsible-header {
    border-bottom: none;
}