/* Admin Panel Styles */

/*
 * This file contains admin-specific styles that extend the main site's styles.
 * The main styles are loaded from styles.css which contains Tailwind classes.
 */

/* Sidebar Link Styles - Match the main site's sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(to right, #059669, #10B981);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

/* Navigation Link Styles */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: #fff;
}

/* Admin Card Styles */
.admin-card {
    background-color: #242424;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #333333;
}

/* Admin Form Styles */
.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #333333;
    background-color: #1A1A1A;
    color: white;
    font-family: 'Manrope', sans-serif;
}

.admin-form input[type="file"] {
    margin-bottom: 1rem;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="email"]:focus,
.admin-form input[type="password"]:focus,
.admin-form input[type="number"]:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Button Styles */
.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #10B981;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.admin-button:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.admin-button i {
    margin-right: 0.5rem;
}

.admin-button.danger {
    background-color: #dc2626;
}

.admin-button.danger:hover {
    background-color: #b91c1c;
}

.admin-button.secondary {
    background-color: #1e293b;
    border: 1px solid #10B981;
}

.admin-button.secondary:hover {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #059669;
}

/* File Upload Styles */
.file-upload-container {
    margin-top: 0.5rem;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #4B5563;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s;
    background-color: rgba(30, 41, 59, 0.5);
}

.file-upload-area.dragover {
    border-color: #10B981;
    background-color: rgba(16, 185, 129, 0.1);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    min-height: 120px;
}

.file-upload-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.current-file-preview {
    display: flex;
    justify-content: center;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.25rem;
}

.file-preview {
    display: none;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(30, 41, 59, 0.7);
    border-radius: 0.25rem;
}

.file-name {
    font-size: 0.875rem;
    color: #E5E7EB;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.remove-file:hover {
    color: #DC2626;
}

/* Login Page Styles */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1A1A1A;
}

.login-container {
    background-color: #242424;
    border-radius: 0.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #333333;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: white;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.login-button:hover {
    background-color: #1d4ed8;
}

.error-message {
    color: #ef4444;
    margin-bottom: 1rem;
    text-align: center;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Responsive Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 0.75rem;
    background-color: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #334155;
}

.admin-table tr:hover {
    background-color: rgba(30, 41, 59, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-table {
        display: block;
        overflow-x: auto;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Menu Editor Styles */
.menu-items-sortable {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    background-color: #242424;
    border: 1px solid #333333;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.menu-item:hover {
    border-color: #10B981;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background-color: #242424;
    transition: background-color 0.3s ease;
}

.menu-item-header:hover {
    background-color: #2A2A2A;
}

.menu-item-title {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.menu-item-actions {
    display: flex;
    gap: 8px;
}

.menu-item-actions button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-item-actions button:hover {
    color: #fff;
    background-color: rgba(59, 130, 246, 0.2);
}

.menu-item-edit {
    padding: 16px;
    border-top: 1px solid #333333;
    background-color: #242424;
}

.handle {
    cursor: grab;
    color: #64748b;
    margin-right: 12px;
    transition: color 0.3s ease;
}

.handle:hover {
    color: #94a3b8;
}

.submenu {
    padding-left: 24px;
    margin: 8px 0;
}

.btn-sm {
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.item-form {
    display: none;
}

.admin-form input[type="text"],
.admin-form select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #1A1A1A;
    border: 1px solid #333333;
    color: #fff;
    transition: all 0.3s ease;
}

.admin-form input[type="text"]:focus,
.admin-form select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.admin-form label {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    display: block;
}

.icon-picker-btn {
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.icon-picker-btn:hover {
    background-color: #3b82f6;
    color: #fff;
}

.menu-item-edit .bg-darker {
    background-color: #1a1a1a;
}

.menu-item-edit .bg-dark {
    background-color: #242424;
}

.menu-item-edit .border-gray-700 {
    border-color: #374151;
}

/* Custom Select Dropdown Styles */
.custom-select-container {
    position: relative;
}

.custom-select-display {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.custom-select-display:hover {
    border-color: #10B981;
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #1A1A1A;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 15rem;
    overflow: hidden;
}

.model-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #e2e8f0;
}

.model-option:hover {
    background-color: #374151;
}

.model-option.bg-primary {
    background-color: #10B981 !important;
    color: white !important;
}

.model-option.bg-primary:hover {
    background-color: #059669 !important;
}

.model-option.keyboard-focus {
    background-color: #374151;
    outline: 2px solid #10B981;
    outline-offset: -2px;
}

/* API Key Peek Eye Styles */
.relative input[type="password"],
.relative input[type="text"] {
    padding-right: 3rem;
}

#toggle_api_key {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

#toggle_api_key:hover {
    color: #10B981 !important;
}

/* Search input in dropdown */
#model_search {
    background-color: #374151;
    border: 1px solid #4B5563;
    color: #e2e8f0;
}

#model_search:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    outline: none;
}