/* ============================================
   Custom Admin Panel Styles
   Complementary styles for admin.css
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Override Bootstrap defaults */
:root {
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #3b82f6;
}

/* Body adjustments */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
}

/* Page wrapper */
#wrapper {
    min-height: 100vh;
}

/* Sidebar width variable */
:root {
    --sidebar-width: 280px;
}

/* Sidebar adjustments */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
}

/* Page content margin */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    min-width: 0;
    width: 100%;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease-in-out;
        z-index: 1050;
    }
    
    #sidebar.open {
        left: 0;
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }
}

/* Card enhancements */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Form enhancements */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Button enhancements */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #6366f1;
    border-color: #6366f1;
}

.btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Table enhancements */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Navbar enhancements */
.navbar {
    background: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    height: 70px;
}

/* Badge enhancements */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Modal enhancements */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    background: #f8fafc;
}

/* Stats card icons */
.stats-card .icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Search input */
.search-input {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Tree view styles */
.tree-wrapper {
    padding: 1rem;
}

.tree-view {
    list-style: none;
    margin: 0;
    padding-left: 1.5rem;
}

.tree-view li {
    margin: 0.5rem 0;
    padding-left: 0;
    position: relative;
}

.tree-view li::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 12px;
    width: 10px;
    height: 1px;
    background: #dbe3f0;
}

.tree-view li::after {
    content: "";
    position: absolute;
    left: -20px;
    top: 0;
    width: 1px;
    height: 100%;
    background: #dbe3f0;
}

.tree-view > li::after {
    display: none;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Utility classes */
.text-gray-800 {
    color: #1e293b !important;
}

.text-gray-300 {
    color: #cbd5e1 !important;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.toast-notification.success {
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.toast-notification.error {
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.toast-notification.warning {
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.toast-notification.info {
    border-left-color: var(--info-color);
    color: var(--info-color);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-notification.success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.toast-notification.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.toast-notification.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.toast-notification.info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

.toast-notification.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Progress bar for auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    animation: progressBar 5s linear forwards;
    transform-origin: left;
}

@keyframes progressBar {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Pause animation on hover */
.toast-notification:hover .toast-progress {
    animation-play-state: paused;
}

/* Print styles */
@media print {
    #sidebar,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    #page-content-wrapper {
        margin-left: 0 !important;
    }
    
    .toast-container {
        display: none !important;
    }
}
