/**
 * Project Name: Webuildaa Hunt
 * Project URI: https://github.com/kiongosss
 * Description: A curated hub for AI tools, SaaS products, and affiliate programs
 * Version: 1.0
 * Author: KaseeMoka
 * Author URI: https://github.com/kiongosss
 * Text Domain: webuildaa-hunt
 */

/* Dropdown z-index fix */
.relative [x-show="open"] {
    z-index: 50 !important;
}

/* Admin Panel Custom Styles - Version 2.0 */

/* Admin Panel Base Styles */
body.admin-panel {
    background-color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

/* Navigation Bar */
.admin-navbar {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 0;
}

.admin-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.admin-logo-container {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    height: 100%;
    transition: all 0.2s ease;
}

.admin-logo-container:hover {
    background-color: #f9fafb;
}

.admin-logo-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-right: 0.75rem;
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.admin-panel-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
}

.admin-user-name {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Horizontal Navigation */
.admin-nav {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    height: 60px;
}

.admin-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.admin-nav-item {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.25rem;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.admin-nav-item-with-dropdown {
    cursor: pointer;
    position: relative;
    z-index: 100; /* Add z-index to create proper stacking context */
}

.admin-nav-dropdown-container {
    position: fixed;
    z-index: 99999; /* Extremely high z-index */
    margin-top: 0.25rem;
    pointer-events: none; /* Allow clicks to pass through when dropdown is hidden */
    width: auto;
    min-width: 200px;
}

.admin-nav-dropdown {
    position: relative;
    min-width: 220px;
    background-color: white;
    border-radius: 0.375rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    padding: 0.5rem 0;
    border: 1px solid #e5e7eb;
    pointer-events: auto; /* Re-enable pointer events for the dropdown itself */
}

.admin-nav-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    font-size: 0.875rem;
    width: 100%;
    border-left: 3px solid transparent;
}

.admin-nav-dropdown-item:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
}

.admin-nav-dropdown-item.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.05);
    border-left: 3px solid var(--primary-color);
}

.admin-nav-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.admin-nav-dropdown-caret {
    margin-left: 0.25rem;
    transition: transform 0.15s ease;
}

.admin-nav-item-with-dropdown.active .admin-nav-dropdown-caret,
.admin-nav-item-with-dropdown:hover .admin-nav-dropdown-caret {
    transform: rotate(180deg);
}

.admin-nav-item-with-dropdown:hover {
    background-color: #f9fafb;
}

.admin-nav-item:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.admin-nav-item.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.admin-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.admin-nav-item:hover .admin-nav-icon,
.admin-nav-item.active .admin-nav-icon {
    opacity: 1;
}

/* Sidebar for Categories */
.admin-sidebar {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    height: fit-content;
    width: 250px;
}

.admin-sidebar-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-categories-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 96px;
    overflow-y: auto;
}

/* Category Items in Sidebar */
.admin-category-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-decoration: none;
}

.admin-category-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.admin-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.admin-nav-text {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Sidebar for Categories */
.admin-sidebar {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    height: fit-content;
}

.admin-sidebar-header {
    margin-bottom: 1.5rem;
}

.admin-categories-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-category-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.admin-category-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.admin-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Main Content Area */
.admin-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    transition: all 0.3s ease;
}

.admin-content:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.admin-content-header {
    margin-bottom: 2rem;
}

.admin-content-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.admin-content-description {
    opacity: 0.7;
}

/* Form Elements */
.admin-form-group {
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.admin-form-group-focus {
    transform: translateY(-2px);
}

.admin-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    color: #4b5563;
}

.admin-form-group-focus .admin-form-label {
    color: var(--primary-color);
}

.admin-form-input,
.admin-form-select,
.admin-form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    background-color: #fff;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-form-input:hover,
.admin-form-select:hover,
.admin-form-textarea:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.admin-form-input:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
    outline: none;
}

.admin-form-input::placeholder,
.admin-form-textarea::placeholder {
    color: #9ca3af;
}

.admin-form-help {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.admin-form-error {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
}

/* Checkbox and Radio Styles */
.admin-form-checkbox,
.admin-form-radio {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.admin-form-checkbox input[type="checkbox"],
.admin-form-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-form-checkbox-icon,
.admin-form-radio-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    position: relative;
    transition: all 0.2s ease;
}

.admin-form-radio-icon {
    border-radius: 50%;
}

.admin-form-checkbox input[type="checkbox"]:checked + .admin-form-checkbox-icon,
.admin-form-radio input[type="radio"]:checked + .admin-form-radio-icon {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.admin-form-checkbox input[type="checkbox"]:checked + .admin-form-checkbox-icon:after {
    content: '';
    position: absolute;
    left: 0.3rem;
    top: 0.1rem;
    width: 0.4rem;
    height: 0.7rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.admin-form-radio input[type="radio"]:checked + .admin-form-radio-icon:after {
    content: '';
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: white;
}

.admin-form-checkbox-label,
.admin-form-radio-label {
    font-size: 0.95rem;
    color: #4b5563;
}

/* Buttons */
/* Standard Admin Buttons */
.admin-btn,
.admin-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    min-width: 160px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.admin-btn:active,
.admin-button:active {
    transform: translateY(0);
}

/* Primary Buttons */
.admin-btn-primary,
.admin-button-primary {
    background-color: #3b82f6;
    color: #fff;
    border: none;
}

.admin-btn-primary:hover,
.admin-button-primary:hover {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

.admin-btn-primary:active,
.admin-button-primary:active {
    background-color: #1d4ed8;
    box-shadow: 0 1px 2px 0 rgba(59, 130, 246, 0.05);
}

/* Outline Buttons */
.admin-btn-outline,
.admin-button-outline {
    background-color: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.admin-btn-outline:hover,
.admin-button-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

/* Secondary Buttons */
.admin-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.admin-btn-secondary:hover {
    background-color: #e5e7eb;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(55, 65, 81, 0.1);
}

/* Danger Buttons */
.admin-btn-danger,
.admin-button-danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

.admin-btn-danger:hover,
.admin-button-danger:hover {
    background-color: #dc2626;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Button Form Actions Container */
.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Button Icons */
.admin-btn-icon,
.admin-button i {
    margin-right: 0.5rem;
}

/* Toggle Switches */
.admin-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.admin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.admin-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked + .admin-toggle-slider {
    background-color: #3b82f6;
}

input:focus + .admin-toggle-slider {
    box-shadow: 0 0 1px #3b82f6;
}

input:checked + .admin-toggle-slider:before {
    transform: translateX(24px);
}

.admin-toggle-label {
    margin: 0 8px;
    font-size: 14px;
    font-weight: 500;
}

.admin-toggle-container {
    display: flex;
    align-items: center;
}

/* Override Tailwind and other framework buttons */
.bg-indigo-600, 
[class*="bg-indigo-"], 
.admin-panel button[type="submit"],
#admin-content button[type="submit"],
.admin-content button[type="submit"],
form button[type="submit"],
.btn-primary,
.btn-blue,
.btn-indigo {
    background-color: #3b82f6 !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.bg-indigo-600:hover, 
[class*="bg-indigo-"]:hover, 
.admin-panel button[type="submit"]:hover,
#admin-content button[type="submit"]:hover,
.admin-content button[type="submit"]:hover,
form button[type="submit"]:hover,
.btn-primary:hover,
.btn-blue:hover,
.btn-indigo:hover {
    background-color: #2563eb !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.admin-btn-icon {
    margin-right: 0.5rem;
}

.admin-btn-ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

.admin-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Cards */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-card-body {
    margin-bottom: 1rem;
}

.admin-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Alerts */
.admin-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.admin-alert-success {
    background-color: #ecfdf5;
    border-left: 4px solid #10b981;
}

.admin-alert-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
}

.admin-alert-warning {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.admin-alert-info {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.admin-alert-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Badges */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-badge-success {
    background-color: #ecfdf5;
    color: #10b981;
}

.admin-badge-warning {
    background-color: #fffbeb;
    color: #f59e0b;
}

.admin-badge-danger {
    background-color: #fef2f2;
    color: #ef4444;
}

.admin-badge-info {
    background-color: #eff6ff;
    color: #3b82f6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-sidebar {
        margin-bottom: 1.5rem;
    }
    
    .admin-navbar-container {
        flex-wrap: wrap;
    }
    
    .admin-logo-container {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        width: 100%;
        justify-content: center;
    }
    
    .admin-nav {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        height: 50px;
    }
    
    .admin-nav-item {
        padding: 0 0.75rem;
    }
    
    .admin-nav-dropdown {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 9999; /* Match desktop z-index */
        background-color: white;
    }
    
    .admin-nav-item-with-dropdown {
        position: static;
    }
}

@media (max-width: 480px) {
    .admin-nav-item {
        padding: 0 0.5rem;
    }
    
    .admin-nav-icon {
        margin-right: 0.35rem;
        width: 1.1rem;
        height: 1.1rem;
    }
    
    .admin-nav-text {
        font-size: 0.75rem;
    }
}
