/**
 * Stanley Staff Management System
 * Custom Styles
 */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fb;
}

main {
    flex: 1;
}

/* Navbar Customization */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* Stats Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger {
    border: none;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover,
.card.bg-warning:hover,
.card.bg-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-group-sm > .btn,
.btn-sm {
    border-radius: 0.25rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: #495057;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Login Page */
.min-vh-100 {
    min-height: 100vh !important;
}

/* Schedule Grid */
.schedule-card {
    transition: all 0.2s ease;
}

.schedule-card:hover {
    transform: translateY(-2px);
}

/* Dropdown Menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:active {
    background-color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.75rem;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Custom Utilities */
.text-dark-50 {
    color: rgba(33, 37, 41, 0.5) !important;
}

.fs-7 {
    font-size: 0.875rem !important;
}

/* Shift Status Colors */
.shift-pending {
    border-left: 4px solid var(--warning-color);
}

.shift-accepted {
    border-left: 4px solid var(--success-color);
}

.shift-declined {
    border-left: 4px solid var(--danger-color);
}

.shift-completed {
    border-left: 4px solid var(--info-color);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* =====================================================
   ENHANCED UI/UX STYLES
   ===================================================== */

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.spinner-wrapper {
    text-align: center;
}

/* Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Input Focus Effects */
.input-focused {
    position: relative;
}

.input-focused::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.input-focused:focus-within::after {
    width: 100%;
    left: 0;
}

/* Pulse Animation for Notifications */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Animation */
.dropdown-menu {
    animation: fadeInDown 0.2s ease;
}

/* Table Enhancements */
.table-hover tbody tr {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Card Hover Effect */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Form Control Animations */
.form-control, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.form-control:focus, .form-select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Badge Hover */
.badge {
    transition: transform 0.2s ease;
}

/* Button Enhancements */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Smooth Link Transitions */
a {
    transition: color 0.2s ease;
}

/* Toast Container */
.toast-container {
    z-index: 1100;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* No Results Row */
.no-results-row td {
    font-style: italic;
}

/* Scroll to Top Button */
#scrollToTop {
    opacity: 0.9;
}

#scrollToTop:hover {
    opacity: 1;
}

/* Stats Card Animation */
.card h3, .card h4 {
    transition: transform 0.3s ease;
}

.card:hover h3, .card:hover h4 {
    transform: scale(1.05);
}

/* Nav Pills Enhancement */
.nav-pills .nav-link {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Alert Animation */
.alert {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal Enhancement */
.modal-content {
    animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Progress Bar Shine Effect */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    100% {
        left: 100%;
    }
}

/* Dark Mode Support */
.dark-mode {
    background-color: #1a1a2e;
    color: #eee;
}

.dark-mode .card {
    background-color: #16213e;
    color: #eee;
}

.dark-mode .navbar {
    background-color: #0f0f23 !important;
}

.dark-mode .table {
    color: #eee;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #1a1a2e;
    border-color: #404060;
    color: #eee;
}

/* Floating Label Animation */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
}

/* List Group Hover */
.list-group-item {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Breadcrumb Enhancement */
.breadcrumb-item + .breadcrumb-item::before {
    transition: color 0.2s ease;
}

/* Action Buttons Group */
.btn-group-sm > .btn {
    transition: all 0.2s ease;
}

.btn-group-sm > .btn:hover {
    z-index: 2;
    transform: scale(1.1);
}

/* Smooth Page Load */
body {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Icon Rotation on Hover */
.bi {
    transition: transform 0.2s ease;
}

.btn:hover .bi {
    transform: scale(1.1);
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background-color: var(--primary-color);
    color: white;
}

