/* app.css - Modern styling for Payslip System */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --light-bg: #f8f9fa;
    --dark-text: #2b2d42;
    --border-radius: 12px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f5f7fb;
    color: var(--dark-text);
}

/* Loading Animation */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.loading-spinner {
    text-align: center;
    color: white;
}

    .loading-spinner .spinner-border {
        width: 3rem;
        height: 3rem;
    }

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Error UI */
.error-ui {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

#blazor-error-ui.show {
    display: block;
}

.error-content {
    background: var(--danger-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(247, 37, 133, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .error-content .reload {
        margin-left: auto;
    }

    .error-content .dismiss {
        cursor: pointer;
        opacity: 0.7;
        transition: var(--transition);
    }

        .error-content .dismiss:hover {
            opacity: 1;
        }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: white;
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    }

.card-header {
    background: white;
    border-bottom: 2px solid var(--light-bg);
    padding: 1.25rem;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

    .btn-primary:hover {
        background: var(--secondary-color);
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    }

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        transform: translateY(-1px);
    }

.btn-success {
    background: var(--success-color);
    border: none;
    color: white;
}

    .btn-success:hover {
        background: #3aa8d8;
        transform: translateY(-1px);
    }

/* Form Controls */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
        outline: none;
    }

.form-label {
    font-weight: 500;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

/* Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: white;
}

    .table thead th {
        background: var(--light-bg);
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
        color: #6c757d;
    }

    .table tbody tr {
        transition: var(--transition);
    }

        .table tbody tr:hover {
            background-color: rgba(67, 97, 238, 0.02);
        }

/* Alert Styles */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

    .badge.bg-success {
        background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    }

    .badge.bg-warning {
        background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
        color: #212529;
    }

    .badge.bg-danger {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    }

/* Progress Bar */
.progress {
    height: 0.75rem;
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 1rem;
    transition: width 0.3s ease;
}

/* Navigation */
.sidebar {
    background: linear-gradient(180deg, #2b2d42 0%, #1e1f2e 100%);
    min-height: 100vh;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

    .nav-link:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(5px);
    }

    .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

/* Responsive Utilities */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }

    .table-responsive {
        border-radius: var(--border-radius);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--secondary-color);
    }

/* Responsive Sidebar Styles */
.page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .page {
        flex-direction: row;
    }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2b2d42 0%, #1e1f2e 100%);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

    .sidebar.show {
        left: 0;
    }

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        left: 0;
        width: 280px;
        flex-shrink: 0;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    animation: fadeIn 0.3s ease;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    background-color: #f5f7fb;
}

/* Mobile Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Content Area */
.content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive Content Padding */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* NavMenu Styles (add these to ensure proper display) */
.nav-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    color: white;
}

    .nav-menu .nav-link {
        color: rgba(255, 255, 255, 0.8);
        border-radius: 10px;
        padding: 0.75rem 1rem;
        transition: all 0.3s ease;
    }

        .nav-menu .nav-link:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            transform: translateX(5px);
        }

        .nav-menu .nav-link.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .nav-menu .nav-link i {
            font-size: 1.2rem;
            width: 24px;
        }

.border-white-10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure proper z-index for dropdowns */
.dropdown-menu {
    z-index: 1060 !important;
}

.gradient-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}