/* ============================================
   UNIVERSITY PARCEL MANAGEMENT SYSTEM
   Professional Modern Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Color Scheme - Professional Blue/Navy */
    --primary-color: #1a56db;
    --primary-light: #1e5fa8;
    --primary-gradient: linear-gradient(135deg, #1a56db 0%, #6366f1 100%);
    
    /* Secondary Colors */
    --secondary-color: #6366f1;
    --success-color: #0e9f6e;
    --danger-color: #f05252;
    --warning-color: #ff5a1f;
    --info-color: #3f83f8;
    --dark-color: #111928;
    
    /* Neutral Colors */
    --background-color: #f3f4f6;
    --text-primary: #111928;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.content-wrapper {
    flex: 1;
    padding-bottom: 50px;
}

/* ===== Navbar & Navigation ===== */
.navbar {
    background: var(--primary-gradient);
    box-shadow: var(--card-shadow);
    border: none;
    padding: 0.4rem 0 !important;
    min-height: auto !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: white !important;
    letter-spacing: -0.5px;
    padding: 0.3rem 1rem !important;
    white-space: nowrap;
}

.navbar-brand i {
    color: #fbbf24;
    margin-right: 6px;
}

.navbar-nav {
    gap: 0.25rem;
    flex-wrap: wrap;
}

.navbar-nav .nav-item {
    margin: 0 2px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
    border-radius: 4px;
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
    display: block;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===== Hero & Page Headers ===== */
.hero-section {
    background: var(--primary-gradient);
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--background-color);
    clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: 300;
}

/* Student Page Header */
.student-page-header {
    background: var(--primary-gradient);
    color: white;
    padding: 60px 0;
    position: relative;
    margin-bottom: 40px;
}

.student-page-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--background-color);
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
}

.student-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.student-page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ===== Cards & Containers ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 20px;
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
}

.card-body {
    padding: 25px;
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 16px;
    background: white;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.dashboard-card .card-body {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

.dashboard-card p {
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.dashboard-card i {
    font-size: 3.5rem;
    opacity: 0.15;
    margin-left: 20px;
}

.dashboard-card.success { border-left: 4px solid var(--success-color); }
.dashboard-card.warning { border-left: 4px solid var(--warning-color); }
.dashboard-card.danger { border-left: 4px solid var(--danger-color); }
.dashboard-card.info { border-left: 4px solid var(--info-color); }

/* Stat Card with Gradient */
.stat-card-gradient {
    border-radius: 16px;
    padding: 28px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.stat-card-gradient:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.stat-card-gradient.blue {
    background: linear-gradient(135deg, #1a56db 0%, #3f83f8 100%);
}

.stat-card-gradient.teal {
    background: linear-gradient(135deg, #0e9f6e 0%, #06b6d4 100%);
}

.stat-card-gradient.orange {
    background: linear-gradient(135deg, #ff5a1f 0%, #fbbf24 100%);
}

.stat-card-gradient.green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.stat-card-gradient.purple {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

.stat-card-gradient::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card-gradient .stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.stat-card-gradient .stat-label {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.stat-card-gradient .stat-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 4rem;
    opacity: 0.15;
}

/* Status Badges */
.status-badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.status-pending {
    background-color: #fef3c7;
    color: #b45309;
}

.status-arrived {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-collected {
    background-color: #f3f4f6;
    color: #374151;
}

/* ===== Buttons ===== */
.btn {
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 86, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-scan {
    background: linear-gradient(135deg, #3f83f8 0%, #1a56db 100%);
    color: white;
}

.btn-scan:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(63, 131, 248, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 16px;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    border: none;
    cursor: pointer;
}

.quick-action-btn:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1a56db 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-action-btn span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== Tables ===== */
.table-responsive {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: var(--primary-gradient);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 16px;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    vertical-align: middle;
    padding: 16px;
    color: var(--text-primary);
}

/* ===== Forms ===== */
.form-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
}

.login-card {
    max-width: 420px;
    width: 100%;
    margin: 20px;
}

.login-card .card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-card .card-body {
    padding: 40px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    font-weight: 700;
}

/* ===== Scanner ===== */
.scanner-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

#qr-reader {
    border: 3px solid var(--primary-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

#qr-reader video {
    width: 100%;
    height: auto;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 3px solid var(--success-color);
    border-radius: 16px;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* ===== Profile Card ===== */
.profile-card {
    text-align: center;
    padding: 30px;
}

.profile-card img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.profile-card h4 {
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ===== Notifications ===== */
.notification-item {
    padding: 16px;
    border-left: 4px solid var(--info-color);
    background-color: #eff6ff;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.notification-item.unread {
    background-color: #fef3c7;
    border-left-color: var(--warning-color);
}

.notification-item .time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Stat Cards ===== */
.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.stat-card i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.stat-card p {
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
    font-weight: 500;
}

.alert i {
    margin-right: 10px;
}

.alert-primary {
    background-color: #eff6ff;
    color: #1e40af;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-warning {
    background-color: #fef3c7;
    color: #b45309;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background-color: #cffafe;
    color: #164e63;
}

/* ===== Pagination ===== */
.pagination {
    margin-top: 20px;
}

.page-link {
    border-radius: 8px;
    margin: 0 3px;
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
}

/* ===== Modal ===== */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 16px 16px 0 0;
    border: none;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ===== Feature Cards ===== */
.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
    background: white;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

.feature-card i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* ===== Timeline ===== */
.parcel-status-timeline {
    position: relative;
    padding: 20px 0;
}

.parcel-status-timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-color);
}

.timeline-item {
    margin-bottom: 24px;
    position: relative;
    padding-left: 60px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.timeline-item.completed::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.timeline-item h5 {
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-item p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.timeline-item .time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Payment Summary ===== */
.payment-summary-box {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.payment-summary-box h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-row.total {
    padding: 16px 0;
    margin-top: 8px;
    border-top: 2px solid var(--primary-color);
}

.payment-row.total .label {
    font-weight: 700;
    color: var(--text-primary);
}

.payment-row.total .amount {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ===== Fee Breakdown Table ===== */
.fee-breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.fee-breakdown-table thead {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.fee-breakdown-table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.fee-breakdown-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.fee-breakdown-table tbody tr:hover {
    background-color: #f9fafb;
}

/* ===== Spinner ===== */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-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;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6366f1 0%, #1a56db 100%);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .student-page-header h1 {
        font-size: 1.8rem;
    }

    .dashboard-card h3 {
        font-size: 2rem;
    }

    .dashboard-card i {
        font-size: 2.5rem;
        margin-left: 15px;
    }

    .stat-card-gradient .stat-number {
        font-size: 2rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .table thead th,
    .table tbody td {
        padding: 12px;
    }

    .login-card .card-body {
        padding: 30px 20px;
    }

    .card-body {
        padding: 20px;
    }

    .quick-action-btn {
        padding: 15px;
    }

    .quick-action-btn i {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .student-page-header {
        padding: 40px 0;
    }

    .student-page-header h1 {
        font-size: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .dashboard-card .card-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-card i {
        margin-left: 0;
        margin-top: 15px;
    }

    .stat-card-gradient .stat-number {
        font-size: 1.8rem;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .payment-summary-box {
        padding: 16px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .no-print,
    .navbar,
    footer {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .btn {
        display: none;
    }

    body {
        background-color: white;
    }

    .content-wrapper {
        padding-bottom: 0;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Utility Classes ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

.shadow {
    box-shadow: var(--card-shadow-hover) !important;
}
