/* Custom styles for Kamvithy Event Platform */

/* Root variables for consistent theming */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --purple-color: #6f42c1;
    
    --font-family-sans-serif: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global styles */
body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--dark-color);
}

/* Custom utility classes */
.text-purple {
    color: var(--purple-color) !important;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

.btn-purple {
    background-color: var(--purple-color);
    border-color: var(--purple-color);
    color: white;
}

.btn-purple:hover {
    background-color: #5a31a3;
    border-color: #5a31a3;
    color: white;
}

/* Navigation enhancements */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* Navbar brand logo (handles non-transparent white backgrounds gracefully) */
.navbar-brand-logo {
    height: 30px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 6px;
    padding: 2px;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* Footer readability on dark background */
footer.bg-dark {
    color: rgba(255,255,255,0.75);
}
footer.bg-dark a {
    color: #f8f9fa;
}
footer.bg-dark a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
}

/* Hero section styles */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #084298 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50" cy="50" r="50"><stop offset="0" stop-color="rgba(255,255,255,.1)"/><stop offset="1" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="10" cy="10" r="1" fill="url(%23a)"/><circle cx="30" cy="5" r="1" fill="url(%23a)"/><circle cx="50" cy="15" r="1" fill="url(%23a)"/><circle cx="70" cy="8" r="1" fill="url(%23a)"/><circle cx="90" cy="12" r="1" fill="url(%23a)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-image {
    position: relative;
    z-index: 2;
}

/* Hero logo sizing */
.hero-logo {
    height: 72px;
    width: auto;
    display: inline-block;
    border-radius: 8px;
    padding: 4px;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* Card enhancements */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.event-card {
    overflow: hidden;
}

.event-card .card-header {
    border-bottom: none;
    font-weight: 600;
}

.event-card .card-body {
    padding: 1.5rem;
}

.event-card .card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem 1.5rem;
}

/* Feature icons */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-icon:hover {
    transform: scale(1.1);
}

/* Event details enhancements */
.event-details {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
}

.event-details i {
    width: 20px;
    text-align: center;
}

/* Progress bar customization */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
}

/* Button enhancements */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Alert customization */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1f2eb;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Form enhancements */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border-width: 2px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Badge enhancements */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Footer styles */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1d23 100%);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warning-color) !important;
}

/* Breadcrumb customization */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: bold;
    color: var(--secondary-color);
}

/* Loading states */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Animation classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* List view styles for events */
.list-view .card {
    margin-bottom: 1rem;
}

.list-view .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.list-view .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .stats-section .col-6 {
        margin-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .text-primary, .text-success, .text-info, .text-warning, .text-danger {
        color: #000 !important;
    }
}

/* Accessibility improvements */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.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;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-outline-primary {
        border-width: 3px;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .text-muted {
        color: #000 !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Khmer font support */
.khmer-text {
    font-family: 'Khmer OS', 'Khmer OS System', 'Khmer OS Muol Light', sans-serif;
}

/* Event status indicators */
.status-open {
    background-color: var(--success-color);
}

.status-full {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-closed {
    background-color: var(--danger-color);
}

.status-cancelled {
    background-color: var(--secondary-color);
}

/* Contact page map placeholder */
.map-placeholder {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Statistics animation */
.stat-item h3 {
    transition: transform 0.3s ease;
}

.stat-item:hover h3 {
    transform: scale(1.2);
}

/* Event card hover effects */
.event-card:hover .card-title {
    color: var(--primary-color);
}

.event-card:hover .btn {
    transform: translateY(-2px);
}

/* Social media icons */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom checkbox and radio styles */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Table styles */
.table th {
    border-top: none;
    font-weight: 600;
    background-color: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.075);
}

/* Modal enhancements */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0 0 1rem 1rem;
}
