/**
 * KSI Medical Aid & Welfare Society
 * Custom Styles
 */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #d6cc70 0%, #c4a050 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c4a050;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d6cc70;
}

/* Button Hover Effects */
.btn-hover-grow {
    transition: transform 0.3s ease;
}

.btn-hover-grow:hover {
    transform: scale(1.05);
}

/* Card Hover Effect */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Image Overlay */
.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    z-index: 1;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #c4a050;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent transition;
}

.form-input:focus {
    outline: none;
}

.form-label {
    @apply block text-sm font-semibold text-gray-700 mb-2;
}

.form-error {
    @apply text-red-500 text-sm mt-1;
}

/* Badge Styles */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold;
}

.badge-primary {
    @apply bg-yellow-100 text-amber-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Alert Styles */
.alert {
    @apply p-4 rounded-lg mb-4;
}

.alert-success {
    @apply bg-green-100 border-l-4 border-green-500 text-green-900;
}

.alert-error {
    @apply bg-red-100 border-l-4 border-red-500 text-red-900;
}

.alert-warning {
    @apply bg-yellow-100 border-l-4 border-yellow-500 text-yellow-900;
}

.alert-info {
    @apply bg-yellow-100 border-l-4 border-amber-500 text-amber-900;
}

/* Table Styles */
.table {
    @apply w-full border-collapse;
}

.table thead {
    @apply bg-gray-100;
}

.table th {
    @apply px-6 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider border-b;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap border-b text-sm;
}

.table tbody tr:hover {
    @apply bg-gray-50;
}

/* Modal Styles */
.modal-backdrop {
    @apply fixed inset-0 bg-black bg-opacity-50 z-40;
}

.modal {
    @apply fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg shadow-2xl z-50 max-w-lg w-full p-6;
}

/* Skeleton Loader */
.skeleton {
    @apply animate-pulse bg-gray-200 rounded;
}

/* Tooltip */
.tooltip {
    @apply invisible absolute z-10 px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm;
}

.tooltip-trigger:hover .tooltip {
    @apply visible;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
:focus {
    outline: 2px solid #c4a050;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #c4a050;
    outline-offset: 2px;
}

/* Custom File Input */
.custom-file-input {
    @apply relative cursor-pointer bg-white border border-gray-300 rounded-lg px-4 py-3 hover:bg-gray-50 transition;
}

.custom-file-input input[type="file"] {
    @apply absolute inset-0 opacity-0 cursor-pointer;
}

/* Progress Bar */
.progress-bar {
    @apply w-full bg-gray-200 rounded-full h-2.5;
}

.progress-bar-fill {
    @apply bg-primary h-2.5 rounded-full transition-all duration-300;
}

/* Divider */
.divider {
    @apply relative my-8;
}

.divider::before {
    content: '';
    @apply absolute left-0 top-1/2 w-full h-px bg-gray-300;
}

.divider-text {
    @apply relative inline-block px-4 bg-white text-gray-500;
}
