:root {
    --mpv-blue: #5083A5;
    --mpv-yellow: #F4C430;
    --mpv-purple: #C77FB5;
    --mpv-pink: #E89AC7;
}

html {
    overflow-y: scroll;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #5083A5;
    letter-spacing: 0.5px;
}

.navbar-brand:hover .navbar-title {
    color: #3d6585;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.notification-badge-conversation {
    background-color: #28a745;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.notification-badge-menu {
    position: absolute;
    top: 5px;
    right: -5px;
    background-color: #ff6b6b;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    min-width: 18px;
    text-align: center;
}

.notification-badge-inline {
    background-color: #28a745;
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.notification-badge-inline-orange {
    background-color: #ff9800;
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.navbar-brand img {
    max-height: 50px;
}

.tile-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-tile {
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    color: white;
    display: block;
    position: relative;
    overflow: hidden;
}

.category-tile-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
    pointer-events: none;
}

.category-tile-content {
    position: relative;
    z-index: 1;
}

.category-tile:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    text-decoration: none;
}

.category-tile i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    color: white;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.category-tile h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.village-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.village-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.village-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

.village-card .card-body {
    padding: 20px;
}

.item-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: var(--mpv-blue);
    border-color: var(--mpv-blue);
}

.btn-primary:hover {
    background-color: #3d6684;
    border-color: #3d6684;
}

.btn-submit {
    background-color: var(--mpv-purple);
    border-color: var(--mpv-purple);
    color: white;
}

.btn-submit:hover {
    background-color: #a665a0;
    border-color: #a665a0;
    color: white;
}

.search-bar {
    max-width: 600px;
    margin: 30px auto;
}

.page-header {
    background: linear-gradient(135deg, var(--mpv-blue), var(--mpv-purple));
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.event-item {
    border-left: 4px solid var(--mpv-blue);
    padding-left: 15px;
    margin-bottom: 15px;
}

.pending-badge {
    background-color: #ffc107;
    color: #000;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
}

.approved-badge {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
}

.nav-tabs .nav-link.active {
    background-color: var(--mpv-blue);
    color: white;
}

footer {
    margin-top: auto;
}

/* FullCalendar Customization */
#calendar {
    max-width: 100%;
    margin: 0 auto;
}

.fc {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fc .fc-toolbar-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--mpv-blue);
}

.fc .fc-button-primary {
    background-color: var(--mpv-blue);
    border-color: var(--mpv-blue);
    transition: all 0.3s ease;
}

.fc .fc-button-primary:hover {
    background-color: #3d6682;
    border-color: #3d6682;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--mpv-purple);
    border-color: var(--mpv-purple);
}

.fc-daygrid-event {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.85rem;
}

.fc-daygrid-event:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.fc-event-title {
    font-weight: 500;
}

.fc-day-today {
    background-color: rgba(80, 131, 165, 0.1) !important;
}

.fc-daygrid-day-number {
    color: #333;
    font-weight: 500;
}

.fc-col-header-cell {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--mpv-blue);
}

/* Event Popover Styling */
.event-popover {
    max-width: 350px;
}

.event-popover .popover-body {
    padding: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.event-popover .popover-body img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
}

.event-popover .popover-header {
    background-color: var(--mpv-blue);
    color: white;
    border-bottom: none;
}

.popover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid #ddd;
}

.popover-body strong {
    color: var(--mpv-blue);
}

.popover-body i {
    color: var(--mpv-purple);
    width: 18px;
    margin-right: 5px;
}

/* Autocomplete/Search Results Overlay */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

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

.autocomplete-item:hover {
    background-color: rgba(80, 131, 165, 0.1);
}

/* Google Translate Widget Styling */
#google_translate_element {
    display: inline-block;
}

#google_translate_element select.goog-te-combo {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 0.9rem !important;
    color: #555 !important;
    background-color: white !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

#google_translate_element select.goog-te-combo:hover {
    background-color: #f8f9fa !important;
    border-color: #5083A5 !important;
}

/* Clean dropdown styling */
.goog-te-combo {
    background-color: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 6px 30px 6px 12px !important;
    font-size: 0.9rem !important;
    color: #555 !important;
    cursor: pointer !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.goog-te-combo:hover {
    background-color: #f8f9fa !important;
    border-color: #5083A5 !important;
}

.goog-te-combo:focus {
    border-color: #5083A5 !important;
    box-shadow: 0 0 0 2px rgba(80, 131, 165, 0.1) !important;
}

/* Hide ALL Google branding */
.goog-te-banner-frame {
    display: none !important;
}

.goog-te-gadget {
    font-size: 0 !important;
    color: transparent !important;
}

.goog-te-gadget > span {
    display: none !important;
}

.goog-te-gadget > div {
    display: none !important;
}

.goog-te-gadget .goog-te-combo {
    margin: 0 !important;
    display: inline-block !important;
}

.goog-te-gadget img {
    display: none !important;
}

.goog-te-gadget a {
    display: none !important;
}

/* Fix body positioning from Google Translate */
body {
    top: 0 !important;
    position: static !important;
}

.skiptranslate iframe {
    visibility: hidden !important;
    display: none !important;
    height: 0 !important;
}

iframe.goog-te-banner-frame {
    display: none !important;
}

body > .skiptranslate {
    display: none !important;
}

.goog-logo-link {
    display: none !important;
}

.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
}

/* Custom Language Selector */
.language-selector {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5083A5 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.language-selector:hover {
    background-color: #f8f9fa;
    border-color: #5083A5;
    color: #5083A5 !important;
}

.language-selector #currentLang {
    font-family: monospace;
    letter-spacing: 0.5px;
}

#languageMenu {
    min-width: 180px;
}

#languageMenu .dropdown-item {
    padding: 8px 16px;
    font-size: 0.9rem;
}

#languageMenu .dropdown-item:hover {
    background-color: rgba(80, 131, 165, 0.1);
    color: #5083A5;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--mpv-blue), var(--mpv-purple));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

.cookie-text a {
    color: white;
    font-weight: 500;
}

.cookie-text a:hover {
    opacity: 0.8;
}

#acceptCookies {
    white-space: nowrap;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

#acceptCookies:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-text {
        justify-content: center;
    }
}

/* Footer Gradient Styling */
.footer-gradient {
    background: linear-gradient(135deg, var(--mpv-blue), var(--mpv-purple));
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.95;
}

.footer-link {
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Global Loading Spinner */
.global-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-spinner.active {
    display: flex;
    opacity: 1;
}

.spinner-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.spinner-content {
    position: relative;
    margin: auto;
    text-align: center;
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.spinner-circle {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--mpv-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-message {
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background-color: #28a745;
    color: white;
}

.toast-error .toast-icon {
    background-color: #dc3545;
    color: white;
}

.toast-info .toast-icon {
    background-color: var(--mpv-blue);
    color: white;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid var(--mpv-blue);
}

/* Smooth Form Transitions */
.form-control:focus,
.form-select:focus {
    border-color: var(--mpv-blue);
    box-shadow: 0 0 0 0.2rem rgba(80, 131, 165, 0.25);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Instant Page Rendering - No delays */
body {
    opacity: 1;
}

body.instant-load {
    transition: none !important;
}

/* Mobile Toast */
@media (max-width: 576px) {
    #toast-container {
        left: 10px;
        right: 10px;
        top: 70px;
    }
    
    .toast-notification {
        min-width: auto;
        width: 100%;
    }
}
