/* Dark Mode Admin Panel Styles - Dark Background, Light Text, Color Accents */

:root {
    --primary-color: #6c5ce7; /* Purple */
    --success-color: #00b894; /* Green */
    --danger-color: #d63031; /* Red */
    --warning-color: #fdcb6e;
    --bg-dark: #ffffff; /* Pure White */
    --bg-darker: #f8f9fa; /* Light Gray */
    --bg-card: #ffffff; /* Pure White */
    --text-light: #000000; /* Pure Black */
    --text-gray: #333333; /* Dark Gray */
    --border-color: #dee2e6; /* Light Gray for borders */
    --sidebar-bg: #ffffff; /* Pure White */
    --hover-bg: #f0f0f0; /* Light Gray for hover */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff; /* Pure White */
    color: #000000; /* Pure Black */
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 20px;
    background: var(--bg-darker);
    border-bottom: 2px solid var(--primary-color);
    border-right: 1px solid var(--border-color);
}

.sidebar-header h5 {
    color: #000000; /* Pure Black */
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

.sidebar .nav-link {
    color: #000000; /* Pure Black */
    padding: 12px 20px;
    border-radius: 0;
    margin: 2px 0;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: var(--hover-bg);
    border-left-color: var(--primary-color);
    color: #000000; /* Pure Black */
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--bg-dark);
}

.top-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.top-header h4 {
    color: #000000; /* Pure Black */
    font-weight: 600;
    margin: 0;
    font-size: 20px;
}

.dropdown-toggle {
    color: #000000; /* Pure Black */
    font-weight: 500;
}

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.dropdown-item {
    color: #000000; /* Pure Black */
    padding: 10px 20px;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.dropdown-item.text-danger:hover {
    color: var(--danger-color);
}

/* Content Area */
.content-area {
    padding: 30px;
    background: var(--bg-dark);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    background: var(--bg-card);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 16px;
    color: #000000; /* Pure Black */
}

.card-header.bg-primary {
    background: var(--primary-color) !important;
    color: white;
    border-bottom: none;
}

.card-header.bg-info {
    background: #0984e3 !important;
    color: white;
    border-bottom: none;
}

.card-header.bg-success {
    background: var(--success-color) !important;
    color: white;
    border-bottom: none;
}

/* Table Styles */
.excel-table {
    margin: 0;
    background: var(--bg-card);
}

.excel-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.excel-table tbody tr:hover {
    background: var(--hover-bg);
}

.excel-table tbody tr:nth-child(even) {
    background: #f8f9fa; /* Light Gray */
}

.excel-table tbody tr:nth-child(even):hover {
    background: var(--hover-bg);
}

.table-label {
    width: 35%;
    padding: 15px 20px;
    background: #f8f9fa; /* Light Gray */
    font-weight: 600;
    color: #000000; /* Pure Black */
    vertical-align: middle;
    border-right: 1px solid var(--border-color);
}

.table-label i {
    color: var(--primary-color);
    font-size: 16px;
}

.table-label strong {
    color: #000000; /* Pure Black */
    font-size: 14px;
}

.table td {
    padding: 15px 20px;
    vertical-align: middle;
    color: #000000; /* Pure Black */
    background: #ffffff; /* Pure White */
}

/* Form Controls */
.form-control {
    border: 2px solid #dee2e6 !important;
    border-radius: 6px;
    padding: 10px 15px;
    color: #000000; /* Pure Black */
    background: #ffffff; /* Pure White */
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border: 2px solid var(--success-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
    outline: none;
    background: #ffffff; /* Pure White */
    color: #000000; /* Pure Black */
}

.form-control::placeholder {
    color: #6c757d; /* Gray for placeholder */
}

.form-select {
    border: 2px solid #dee2e6 !important;
    border-radius: 6px;
    padding: 10px 15px;
    color: #000000; /* Pure Black */
    background: #ffffff; /* Pure White */
    font-size: 14px;
}

.form-select:focus {
    border: 2px solid var(--success-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
    outline: none;
    background: #ffffff; /* Pure White */
    color: #000000; /* Pure Black */
}

/* Form Switch - Always visible, gray when off, green when on */
.form-check-input {
    width: 45px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    z-index: 10;
    margin: 0;
    opacity: 0;
    background: transparent;
    border: none;
}

/* Toggle switch container */
.form-switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
    min-height: 24px;
    cursor: pointer;
}

/* Toggle switch track - ALWAYS visible, gray when unchecked */
.form-switch::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 45px;
    height: 24px;
    background: #dee2e6; /* Gray when unchecked */
    border-radius: 12px;
    transition: all 0.3s;
    opacity: 1 !important; /* Always visible */
    pointer-events: none;
}

/* Toggle switch circle - ALWAYS visible */
.form-switch::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    opacity: 1 !important; /* Always visible */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Green background when checked */
.form-switch:has(.form-check-input:checked)::before,
.form-switch.toggle-checked::before {
    background: var(--success-color) !important; /* Green when checked */
}

/* Move circle to right when checked */
.form-switch:has(.form-check-input:checked)::after,
.form-switch.toggle-checked::after {
    left: 23px !important;
}

/* Removed duplicate - handled above */

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--success-color) !important; /* Green */
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #00a085 !important; /* Darker Green */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #00a085;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c02929;
}

.btn-secondary {
    background: #636e72;
    color: white;
}

.btn-secondary:hover {
    background: #555a5f;
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: #6c757d !important; /* Gray */
    font-size: 12px;
}

/* Logo Preview */
.logo-preview-small {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000; /* Pure Black */
}

.logo-preview-small img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Footer */
.main-footer {
    background: #ffffff; /* Pure White */
    border-top: 1px solid var(--border-color);
    padding: 15px 30px;
    color: #000000; /* Pure Black */
    font-size: 13px;
}

.main-footer a {
    color: #000000; /* Pure Black */
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-footer a:hover {
    color: var(--primary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Pure Black with transparency */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay .spinner-border {
    color: var(--primary-color);
}

.loading-overlay p {
    color: #000000; /* Pure Black */
}

/* Modals */
.modal-content {
    background: #ffffff; /* Pure White */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
}

.modal-title {
    color: #000000; /* Pure Black */
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    color: #000000; /* Pure Black */
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
}

.btn-close {
    filter: invert(1);
}

/* Alerts */
.alert {
    border-radius: 6px;
    border: none;
    padding: 12px 15px;
    font-size: 14px;
}

.alert-success {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success-color);
    border-left: 3px solid var(--success-color);
}

.alert-danger {
    background: rgba(214, 48, 49, 0.15);
    color: var(--danger-color);
    border-left: 3px solid var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .table-label {
        width: 40%;
        font-size: 13px;
    }
}

/* Sidebar Toggle */
#sidebarToggle {
    color: var(--text-light);
    font-size: 20px;
}

/* Required Field Indicator */
.text-danger {
    color: var(--danger-color) !important;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* All Input Boxes - Borders - Comprehensive */
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
input[type="tel"],
input[type="search"],
textarea,
select,
.form-control,
.form-select {
    border: 2px solid #333333 !important;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Focus State - All Inputs */
input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    border: 2px solid var(--success-color) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
    background: #ffffff !important;
    color: #000000 !important;
}

/* File Input Specific */
input[type="file"] {
    border: 2px solid #dee2e6 !important;
    padding: 8px;
    cursor: pointer;
    background: #ffffff !important;
}

input[type="file"]:focus {
    border: 2px solid var(--success-color) !important;
}

/* Number Input Specific */
input[type="number"] {
    border: 2px solid #dee2e6 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

input[type="number"]:focus {
    border: 2px solid var(--success-color) !important;
}

/* Toggle styles consolidated in main form-switch section above */

/* Select Dropdown Borders */
select.form-select,
select.form-control {
    border: 2px solid #dee2e6 !important;
    background: #ffffff !important;
    color: #000000 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

select.form-select:focus,
select.form-control:focus {
    border: 2px solid var(--success-color) !important;
}

/* Textarea Borders */
textarea.form-control {
    border: 2px solid #dee2e6 !important;
    min-height: 100px;
    resize: vertical;
    background: #ffffff !important;
    color: #000000 !important;
}

textarea.form-control:focus {
    border: 2px solid var(--success-color) !important;
}

/* Ensure all inputs in tables have borders */
.excel-table input,
.excel-table select,
.excel-table textarea {
    border: 2px solid #dee2e6 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

.excel-table input:focus,
.excel-table select:focus,
.excel-table textarea:focus {
    border: 2px solid var(--success-color) !important;
}
