/* Modern Theme Enhancement for Pewaca Admin */
/* Version 2.0 - Complete Modern Redesign */

:root {
    /* Modern Indigo/Slate Palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-accent: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Global text color fix */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark) !important;
    background-color: #f8fafc;
}

/* Page Container */
#content-main {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 1.5rem;
    padding: 1.5rem;
}

/* Page Title */
h1, .page-title {
    color: var(--text-dark) !important;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Breadcrumbs */
.breadcrumbs, ul.flex {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--primary-color) !important;
    text-decoration: none;
}

/* Search & Filter Bar */
.bg-gray-50 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg) !important;
    padding: 1rem !important;
}

/* Search Input */
input[type="text"],
input[type="search"],
#searchbar {
    background: white !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-dark) !important;
    font-size: 0.875rem;
    padding: 0.625rem 1rem !important;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="search"]:focus,
#searchbar:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}

/* Select Dropdown */
select {
    background: white !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-dark) !important;
    padding: 0.625rem 1rem !important;
    min-width: 180px;
    cursor: pointer;
}

/* ====== TABLE STYLES ====== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1rem;
}

/* Table Header */
table thead tr {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
}

table thead th {
    background: transparent !important;
    color: white !important;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem !important;
    text-align: left;
    border: none !important;
}

/* Table Body */
table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

table tbody tr:hover {
    background-color: #eef2ff !important;
}

table tbody td {
    padding: 1rem 1.25rem !important;
    color: var(--text-dark) !important;
    font-size: 0.875rem;
    font-weight: 500;
    vertical-align: middle;
    border: none !important;
}

/* Table Links */
table tbody td a {
    color: var(--text-dark) !important;
    text-decoration: none;
    font-weight: 500;
}

table tbody td a:hover {
    color: var(--primary-color) !important;
}

/* Image in Table */
table tbody td img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid white;
}

/* ====== BUTTON STYLES ====== */
/* Primary Button - Tambah */
.bg-indigo-500,
button[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 0.625rem 1.25rem !important;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px 0 rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.bg-indigo-500:hover,
button[type="submit"]:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(99, 102, 241, 0.4);
}

/* Edit Button */
a[href*="edit"],
.btn-edit,
button.edit-btn,
a.edit {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

a[href*="edit"]:hover,
.btn-edit:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    transform: translateY(-1px);
}

/* Delete Button */
a[href*="delete"],
.btn-delete,
button.delete-btn,
a.delete {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

a[href*="delete"]:hover,
.btn-delete:hover {
    background: linear-gradient(135deg, var(--danger-hover) 0%, #ef4444 100%) !important;
    transform: translateY(-1px);
}

/* Success/Green Button */
.bg-green-500,
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
    color: white !important;
}

/* Action Buttons Container */
td:last-child {
    white-space: nowrap;
}

td:last-child a,
td:last-child button {
    margin-right: 0.5rem;
}

/* ====== SIDEBAR NAVIGATION ====== */
aside, .sidebar, nav[aria-label="Navigations"] {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

.sidebar a,
aside a,
nav a {
    color: #94a3b8 !important;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.sidebar a:hover,
aside a:hover,
nav a:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #e2e8f0 !important;
}

.sidebar a.active,
aside a[aria-current="page"],
nav a.active {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
    color: white !important;
}

/* ====== MODAL STYLES ====== */
.modal-content,
[x-show="open"],
.dialog-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
}

.modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem;
}

/* ====== FORM STYLES ====== */
.form-group,
.field-box {
    margin-bottom: 1.25rem;
}

label {
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

textarea {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    width: 100%;
    min-height: 100px;
    transition: all 0.2s ease;
}

textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #6366f1;
    color: white !important;
}

.pagination .current,
.pagination .active {
    background: #4f46e5;
    color: white !important;
}

/* ====== CHECKBOX ====== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

/* ====== ALERTS/MESSAGES ====== */
.alert,
.messages li,
.errornote {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

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

.alert-error,
.errornote {
    background: #fef2f2;
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    #content-main {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    table thead th,
    table tbody td {
        padding: 0.75rem 0.5rem !important;
    }
    
    table tbody td img {
        width: 40px;
        height: 40px;
    }
}

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

#content-main {
    animation: fadeIn 0.3s ease-out;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Button improvements */
.btn, button[type="submit"], input[type="submit"] {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover, button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

/* Form improvements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Search box */
input[type="search"] {
    border-radius: 24px;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Image thumbnails */
img {
    border-radius: 8px;
    object-fit: cover;
}

/* Sidebar navigation */
.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.sidebar a {
    border-radius: 8px;
    transition: all 0.2s ease;
    margin: 0.25rem 0;
}

.sidebar a:hover {
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateX(4px);
}

.sidebar a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Action buttons in table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    border-radius: 8px;
    overflow: hidden;
}

.pagination li a {
    border: none;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.pagination li a:hover {
    background-color: #667eea;
    color: white;
}

.pagination li.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Modal improvements */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

/* Badge/label improvements */
.badge {
    border-radius: 12px;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Loading spinner */
.spinner-border {
    border-width: 3px;
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card {
        border-radius: 8px;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Utility classes */
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}
