/**
 * Kolkata Durga Puja Theme - Custom CSS
 *
 * Additional custom styles
 *
 * @package KolkataDurgaPuja
 */

/* ================================
   Additional Decorative Elements
   ================================ */

/* Ornate border decoration for sections */
.section::before,
.section::after {
    content: '❧';
    position: absolute;
    font-size: 20px;
    color: var(--color-secondary);
}

.section::before {
    top: 8px;
    left: 8px;
}

.section::after {
    bottom: 8px;
    right: 8px;
    transform: rotate(180deg);
}

/* Decorative heading underline */
.section-title.decorative::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary), transparent);
    margin-top: 8px;
}

/* ================================
   Menu Toggle (Mobile)
   ================================ */
.menu-toggle {
    display: none;
    background: var(--color-secondary);
    border: none;
    color: var(--color-primary-dark);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-toggle:hover {
    background: var(--color-secondary-light);
}

/* ================================
   Logged In Message
   ================================ */
.logged-in-message {
    color: var(--color-text-light);
    font-size: 12px;
}

.logged-in-message a {
    color: var(--color-secondary);
    margin-left: 12px;
    text-decoration: underline;
}

/* ================================
   Parikrama Item Expanded State
   ================================ */
.parikrama-item.expanded p {
    max-height: none;
}

/* ================================
   Quick Links List Enhancement
   ================================ */
.quick-links-list li:nth-child(odd) {
    background-color: rgba(218, 165, 32, 0.05);
}

.quick-links-list li:hover {
    background-color: rgba(218, 165, 32, 0.15);
}

/* ================================
   Sidebar Widget Enhancement
   ================================ */
.sidebar-widget {
    position: relative;
    overflow: hidden;
}

.sidebar-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary), var(--color-primary));
}

/* ================================
   Banner Widget Enhancement
   ================================ */
.banner-widget {
    padding: 0;
    border: none;
}

.banner-widget::before {
    display: none;
}

.banner-widget a {
    display: block;
    position: relative;
}

.banner-widget a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--color-border);
    pointer-events: none;
}

/* ================================
   Gallery Strip Enhancement
   ================================ */
.gallery-images {
    position: relative;
}

.gallery-images::before,
.gallery-images::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-secondary);
    font-size: 16px;
}

.gallery-images::before {
    left: -20px;
}

.gallery-images::after {
    right: -20px;
}

/* ================================
   Footer Enhancement
   ================================ */
.site-footer::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--color-secondary), transparent);
    margin-bottom: 16px;
}

/* ================================
   Form Elements Enhancement
   ================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-secondary) !important;
    box-shadow: 0 0 4px rgba(218, 165, 32, 0.4);
}

/* ================================
   Button Enhancement
   ================================ */
button,
.btn-submit,
.btn-search {
    position: relative;
    overflow: hidden;
}

button::after,
.btn-submit::after,
.btn-search::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::after,
.btn-submit:hover::after,
.btn-search:hover::after {
    left: 100%;
}

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

::-webkit-scrollbar-track {
    background: var(--color-background);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-primary), var(--color-primary-dark));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* ================================
   Selection Styling
   ================================ */
::selection {
    background-color: var(--color-secondary);
    color: var(--color-primary-dark);
}

::-moz-selection {
    background-color: var(--color-secondary);
    color: var(--color-primary-dark);
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .top-header,
    .main-navigation,
    .sidebar,
    .gallery-strip,
    .site-footer {
        display: none;
    }
    
    .site-content {
        max-width: 100%;
    }
    
    .content-area {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .section {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* ================================
   AJAX Search Styles
   ================================ */

/* Search Container */
.kdp-search-container {
    position: relative;
}

/* Search Input Wrapper */
.kdp-search-input-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.kdp-search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.kdp-search-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
}

.kdp-search-input::placeholder {
    color: #999;
    font-style: italic;
}

.kdp-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-secondary);
    font-size: 16px;
    pointer-events: none;
}

.kdp-search-loading {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
}

/* Filter Dropdowns */
.kdp-filter-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.kdp-filter-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-size: 11px;
    background-color: #fff;
    color: var(--color-text-primary);
    cursor: pointer;
}

.kdp-filter-select:focus {
    outline: none;
    border-color: var(--color-secondary);
}

/* Search Results Container */
.kdp-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 2px;
}

/* Individual Result Item */
.kdp-result-item {
    padding: 10px;
    border-bottom: 1px solid var(--color-background-dark);
    transition: background-color 0.15s ease;
}

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

.kdp-result-item:hover,
.kdp-result-item.kdp-selected {
    background-color: var(--color-background);
}

.kdp-result-link {
    display: flex;
    text-decoration: none !important;
    color: inherit;
}

.kdp-result-link:hover {
    text-decoration: none !important;
}

/* Result Thumbnail */
.kdp-result-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid var(--color-border);
    margin-right: 10px;
    flex-shrink: 0;
}

/* Result Content */
.kdp-result-content {
    flex: 1;
    min-width: 0;
}

.kdp-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.kdp-result-item:hover .kdp-result-title,
.kdp-result-item.kdp-selected .kdp-result-title {
    color: var(--color-secondary);
}

.kdp-result-meta {
    font-size: 10px;
    color: var(--color-text-secondary);
    margin-bottom: 3px;
}

.kdp-meta-item {
    display: inline-block;
    margin-right: 8px;
}

.kdp-meta-item strong {
    color: var(--color-text-primary);
}

.kdp-result-address {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No Results Message */
.kdp-no-results {
    padding: 15px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 12px;
    font-style: italic;
}

/* Loading State */
.kdp-search-loading img {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Search Widget Specific */
.kdp-search-widget {
    position: relative;
    overflow: visible;
}

/* Highlight matched text */
.kdp-highlight {
    background-color: var(--color-secondary-light);
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .kdp-search-results {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        max-height: 50vh;
    }
    
    .kdp-result-thumb {
        width: 40px;
        height: 40px;
    }
    
    .kdp-result-title {
        font-size: 12px;
    }
}

/* CSS Spinner for Loading */
.kdp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: kdp-spin 0.8s linear infinite;
}

@keyframes kdp-spin {
    to { transform: rotate(360deg); }
}
