/* Custom CSS for Punjab DLIMS - Enhanced Styles */

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced Header Styles */
header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Logo animation */
header img {
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05);
}

/* Navigation links with gradient underline */
nav a {
    position: relative;
    transition: all 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

/* Page transitions */
.page {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    animation: slideUp 0.6s ease-out;
}

.page.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Button styles */
button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* Enhanced Form styles */
input,
select,
textarea {
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #93c5fd;
}

/* Card hover effects */
.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Tab styles */
.tab-btn.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.tab-btn:not(.active) {
    border-bottom-color: transparent;
    color: #6b7280;
}

.tab-btn:not(.active):hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

/* Loading animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success message animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .text-4xl.md\:text-5xl {
        font-size: 2.25rem;
    }
}

@media (max-width: 640px) {
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .text-3xl.md\:text-4xl {
        font-size: 1.875rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000000;
    }
    
    .text-gray-700 {
        color: #000000;
    }
    
    .bg-gray-50 {
        background-color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Logo styles */
.logo {
    font-family: "Pacifico", serif;
}

/* Custom green theme colors */
.bg-green-custom {
    background-color: #16a34a;
}

.text-green-custom {
    color: #16a34a;
}

.border-green-custom {
    border-color: #16a34a;
}

/* Animation for search results */
.search-result-enter {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table responsive styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Status badge styles */
.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-suspended {
    background-color: #fef3c7;
    color: #92400e;
}

.status-expired {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Form validation styles */
.form-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

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

.notification.error {
    background-color: #ef4444;
}

.notification.warning {
    background-color: #f59e0b;
}

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

/* Card animation */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease-in-out;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Custom select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
}

/* Utility classes */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.break-words {
    word-wrap: break-word;
    word-break: break-word;
}

.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* Print-specific styles */
@page {
    margin: 1in;
}

@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
}

/* ============================================ */
/* ENHANCED HOME PAGE STYLES */
/* ============================================ */

/* Hero Section: simplified white background to match screenshot */
#home-page .bg-white {
    background: white;
    position: relative;
    overflow: visible;
}

#home-page h1 {
    color: #0f172a !important; /* dark slate */
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Form Enhancement */
#search-form {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

/* Search form look: white input with subtle shadow; focus ring in blue; labels dark */
#search-form input {
    background: white;
    border: 1px solid #e6eefb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition: all 0.18s ease;
}

#search-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12), 0 0 0 4px rgba(59, 130, 246, 0.06);
}

#search-form label {
    color: #0f172a !important;
    font-weight: 700;
}

/* Blue submit button to match screenshot */
#search-form button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.16);
    border: none;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

#search-form button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 14px 40px rgba(37, 99, 235, 0.18);
    transform: translateY(-3px);
}

/* Search Result Card: softer, pale-green card matching screenshot */
#search-result {
    animation: bounceIn 0.45s ease-out;
    background: linear-gradient(180deg, #f6fffa 0%, #ecfdf5 100%);
    border: 1px solid #c7f0df;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.12);
    padding: 18px;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#search-result i {
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Features Section Enhancement */
.bg-gray-100 {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
}

/* Feature Cards with hover effect */
.flex.flex-col.items-center {
    transition: all 0.3s ease;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
}

.flex.flex-col.items-center:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.flex.flex-col.items-center i {
    transition: all 0.3s ease;
    display: inline-block;
}

.flex.flex-col.items-center:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Traffic Safety Section Enhancement */
.bg-green-50 {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
}

/* Traffic Safety Cards */
.border-l-4 {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.border-l-4::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #10b981, #059669);
    transition: height 0.3s ease;
}

.border-l-4:hover::before {
    height: 100%;
}

.border-l-4:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

/* Icon background animations */
.bg-green-100 {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    position: relative;
    overflow: hidden;
}

.bg-green-100::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

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

/* Glowing text effect */
.text-green-600 {
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Mobile menu enhancement */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #3b82f6);
}

/* Text gradient effect */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading state enhancement */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Floating animation for icons */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Success message enhancement */
.text-green-600.font-semibold {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    }
}

/* ============================================ */
/* FOOTER STYLES */
/* ============================================ */

footer {
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: footerShine 3s infinite;
}

@keyframes footerShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

footer h3 {
    position: relative;
    display: inline-block;
}

footer h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
}

footer a {
    position: relative;
    display: inline-block;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #10b981;
    transition: width 0.3s ease;
}

footer a:hover::before {
    width: 100%;
}

footer ul li {
    transition: all 0.3s ease;
}

footer ul li:hover {
    transform: translateX(5px);
}

/* ============================================ */
/* RESPONSIVE ENHANCEMENTS */
/* ============================================ */

@media (max-width: 768px) {
    #home-page h1 {
        font-size: 2rem;
    }

    .grid.grid-cols-1.md\:grid-cols-3 {
        gap: 2rem;
    }

    .border-l-4:hover {
        transform: translateX(5px);
    }
}

@media (max-width: 480px) {
    #home-page h1 {
        font-size: 1.75rem;
    }

    #search-form input {
        font-size: 14px;
    }

    #search-form button {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ============================================ */
/* ACCESSIBILITY ENHANCEMENTS */
/* ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #10b981;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }
    
    input,
    select,
    textarea {
        border: 2px solid currentColor;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can add dark mode styles here if needed */
}

/* ============================================ */
/* PERFORMANCE OPTIMIZATIONS */
/* ============================================ */

/* GPU acceleration for animations */
.page,
button,
.border-l-4,
.flex.flex-col.items-center {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}