/* WP Wartung Dashboard - UI Components */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-primary:active:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.dark .btn-secondary {
    background-color: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e5e7eb;
}

.dark .btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-ghost {
    background-color: transparent;
    color: #6b7280;
}

.btn-ghost:hover:not(:disabled) {
    background-color: #f3f4f6;
    color: #374151;
}

.dark .btn-ghost:hover:not(:disabled) {
    background-color: #374151;
    color: #d1d5db;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.dark .card {
    background-color: #1f2937;
    border-color: #374151;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .card-header {
    border-color: #374151;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.dark .card-footer {
    border-color: #374151;
    background-color: #111827;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dark .form-label {
    color: #d1d5db;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.dark .form-input:disabled,
.dark .form-select:disabled,
.dark .form-textarea:disabled {
    background-color: #4b5563;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #ef4444;
}

.form-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.dark .form-hint {
    color: #9ca3af;
}

/* ========================================
   TABLES
   ======================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.dark .data-table th {
    color: #9ca3af;
    border-color: #374151;
}

.data-table td {
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.dark .data-table td {
    border-color: #374151;
    color: #d1d5db;
}

.data-table tr:hover td {
    background-color: #f9fafb;
}

.dark .data-table tr:hover td {
    background-color: #374151;
}

.data-table .sortable {
    cursor: pointer;
    user-select: none;
}

.data-table .sortable:hover {
    color: #374151;
}

.dark .data-table .sortable:hover {
    color: #d1d5db;
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.dark .modal {
    background-color: #1f2937;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .modal-header {
    border-color: #374151;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    border-radius: 0.375rem;
}

.modal-close:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.dark .modal-close:hover {
    color: #d1d5db;
    background-color: #374151;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.dark .modal-footer {
    border-color: #374151;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slide-out 0.3s ease-in forwards;
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-warning {
    background-color: #f59e0b;
    color: white;
}

.toast-info {
    background-color: #3b82f6;
    color: white;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-content {
    flex: 1;
    font-size: 0.875rem;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: currentColor;
    opacity: 0.7;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.toast-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   LOADING SPINNERS
   ======================================== */

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.dark .spinner {
    border-color: #374151;
    border-top-color: #3b82f6;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-lg {
    width: 2rem;
    height: 2rem;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dark .loading-overlay {
    background-color: rgba(17, 24, 39, 0.8);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-green {
    background-color: #d1fae5;
    color: #065f46;
}

.dark .badge-green {
    background-color: #064e3b;
    color: #6ee7b7;
}

.badge-yellow {
    background-color: #fef3c7;
    color: #92400e;
}

.dark .badge-yellow {
    background-color: #78350f;
    color: #fcd34d;
}

.badge-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.dark .badge-red {
    background-color: #7f1d1d;
    color: #fca5a5;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .badge-blue {
    background-color: #1e3a8a;
    color: #93c5fd;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #374151;
}

.dark .badge-gray {
    background-color: #374151;
    color: #d1d5db;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: 16rem;
    background-color: #111827;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #3b82f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-text {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background-color: #374151;
    color: white;
}

.sidebar-nav-item.active {
    background-color: #3b82f6;
    color: white;
}

.sidebar-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #374151;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
}

.dark .login-card {
    background-color: #1f2937;
}

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

.login-logo {
    width: 4rem;
    height: 4rem;
    background-color: #3b82f6;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.dark .login-title {
    color: #f3f4f6;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .login-subtitle {
    color: #9ca3af;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #9ca3af;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.dark .empty-state-title {
    color: #d1d5db;
}

.empty-state-text {
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 20rem;
    margin: 0 auto 1.5rem;
}

.dark .empty-state-text {
    color: #9ca3af;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination-btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.dark .pagination-btn {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.dark .pagination-btn:hover:not(:disabled) {
    background-color: #4b5563;
}

.pagination-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
