/* Main Styles for SPI System */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --text-dark: #111827;
    --text-medium: #374151;
    --text-light: #6b7280;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --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 -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(to bottom, var(--secondary-color), var(--dark-color));
    color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    margin: 5px 10px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    padding: 20px 15px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Styles */
.main-content {
    padding: 20px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 15px 20px;
}

.card-dashboard {
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.card-dashboard .card-body {
    padding: 25px;
}

/* Dashboard Cards */
.card-stats {
    color: white;
    overflow: hidden;
    position: relative;
}

.card-stats i.stats-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 5rem;
    opacity: 0.2;
}

.card-stats.primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.card-stats.success {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.card-stats.warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid var(--gray-200);
    padding: 0.875rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    color: var(--gray-800);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.table th {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    border: none;
    font-weight: 700;
    color: var(--gray-800);
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-color: var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* List Groups */
.list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Header Styles */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--gray-800);
}

.display-4 {
    font-weight: 800;
    font-size: 2.5rem;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.card-dashboard {
    animation: fadeInUp 0.6s ease-out;
}

.sidebar .nav-link {
    animation: slideInRight 0.4s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .card-dashboard {
        margin-bottom: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .main-content h1 {
        font-size: 1.75rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-img {
        margin-bottom: 20px;
    }
    
    /* Tablet-specific improvements */
    .table-responsive {
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .btn-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-toolbar .btn-group {
        width: 100%;
        justify-content: center;
    }
    
    /* Improve card layouts */
    .row .col-lg-3,
    .row .col-lg-4,
    .row .col-lg-6 {
        margin-bottom: 1.5rem;
    }
    
    /* Better navigation */
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Improve form layouts */
    .form-floating {
        margin-bottom: 1rem;
    }
    
    /* Better alert positioning */
    .alert {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .sidebar {
        width: 100vw;
    }
    
    /* Mobile-specific table improvements */
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
    
    /* Stack form elements vertically */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Improve button groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    /* Better spacing for mobile */
    .gap-3 {
        gap: 0.5rem !important;
    }
    
    .gap-4 {
        gap: 0.75rem !important;
    }
    
    /* Improve search and filter layout */
    .d-flex.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .input-group {
        margin-bottom: 0.5rem;
    }
    
    /* Better modal sizing */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Improve pagination */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Medium mobile devices (577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Better form layouts for medium screens */
    .row .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .row .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .row .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
     
    .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }

/* Nav Tabs */
.nav-tabs .nav-link {
    color: var(--dark-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

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

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Enhanced Card Styles */
.card-dashboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--info-color));
}

.card-dashboard:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Enhanced Form Styles */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.875rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: none;
    font-weight: 700;
    color: var(--gray-800);
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-color: rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.5);
}

.table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.1);
}

/* Enhanced Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    backdrop-filter: blur(10px);
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
    color: white;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white;
}

/* Enhanced List Group Styles */
.list-group {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-flush .list-group-item {
    background: transparent;
}

/* Status indicators */
.text-success {
    color: var(--success-color) !important;
}

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

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

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

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

/* Alert Styles */
.alert {
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}
