/* District, Taluk & Village Directory Styles */
/* Primary orange theme: #ff6725 and its shades */

/* Custom Cursor Styles - Matching site theme */
.rera-search-tab, .location-card, .directory-item, .suggestion-item,
.rera-search-form #clear-search, .page-link, .form-check-label,
.hierarchy-item {
    cursor: url(../dashboard/images/icon/pointer.svg), auto !important;
}

.rera-search-form input[type="text"] {
    cursor: url(../dashboard/images/icon/type.svg), auto !important;
}

.form-check-input[type="radio"] {
    cursor: url(../dashboard/images/icon/pointer.svg), auto !important;
}

:root {
    --primary-orange: #ff6725;
    --primary-orange-light: #ff8850;
    --primary-orange-lighter: #ffaa7a;
    --primary-orange-lightest: #ffcca5;
    --primary-orange-dark: #e5511b;
    --primary-orange-darker: #cc4617;
    --primary-orange-darkest: #b33b12;
    --secondary-blue: #17a2b8;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
    --danger-red: #dc3545;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
}

/* Search Section Styles */
.rera-search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.rera-search-tab {
    background: white;
    border: 2px solid var(--primary-orange-lighter);
    color: var(--primary-orange);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.rera-search-tab:hover {
    background: var(--primary-orange-lightest);
    border-color: var(--primary-orange);
    transform: translateY(-2px);
}

.rera-search-tab.active {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-light) 100%);
    border-color: var(--primary-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 103, 37, 0.3);
}

.rera-search-form {
    margin-bottom: 20px;
}

.rera-search-form input[type="text"] {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--primary-orange-lighter);
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.rera-search-form input[type="text"]:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 37, 0.25);
    outline: none;
}

.rera-search-form #clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rera-search-form #clear-search:hover {
    background: var(--primary-orange-dark);
    transform: translateY(-50%) scale(1.05);
}

/* Area Type Radio Buttons */
.form-check {
    display: flex;
    align-items: center;
    margin: 0;
}

.form-check-input {
    margin-right: 8px;
    accent-color: var(--primary-orange);
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-orange-lighter);
    background-color: white;
    position: relative;
}

.form-check-input:checked {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
}

.form-check-input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 37, 0.25);
    outline: none;
}

.form-check-input:hover {
    border-color: var(--primary-orange);
}

/* Custom radio button styling for better cross-browser support */
.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.form-check-label {
    font-weight: 500;
    color: var(--dark-gray);
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.form-check-label:hover {
    color: var(--primary-orange-dark);
}

/* Search Suggestions */
#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border: 1px solid var(--primary-orange-lighter);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--primary-orange-lightest);
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: var(--primary-orange-lightest);
    color: var(--primary-orange-dark);
}

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

.suggestion-type {
    font-size: 11px;
    background: var(--primary-orange);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.suggestion-hierarchy {
    font-size: 12px;
    color: var(--medium-gray);
    margin-top: 2px;
}

/* Results Grid */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.location-card {
    background: white;
    border: 2px solid var(--primary-orange-lightest);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange) 0%, var(--primary-orange-light) 100%);
}

.location-card:hover {
    border-color: var(--primary-orange);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 103, 37, 0.15);
}

.location-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-orange-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-type {
    font-size: 11px;
    background: var(--primary-orange);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-hierarchy {
    font-size: 13px;
    color: var(--medium-gray);
    line-height: 1.4;
    margin-top: 10px;
}

.location-code {
    font-size: 12px;
    background: var(--light-gray);
    color: var(--primary-orange-dark);
    padding: 2px 8px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Area Type Indicators */
.area-type-rural {
    border-left: 4px solid var(--success-green);
}

.area-type-urban {
    border-left: 4px solid var(--secondary-blue);
}

/* Directory Navigation */
#directory-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--primary-orange-lighter);
    border-radius: 10px;
    background: white;
}

.directory-level {
    border-bottom: 1px solid var(--primary-orange-lightest);
}

.directory-level:last-child {
    border-bottom: none;
}

.directory-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.directory-item:hover {
    background: var(--primary-orange-lightest);
    color: var(--primary-orange-dark);
}

.directory-item-name {
    font-weight: 600;
    color: var(--dark-gray);
}

.directory-item-count {
    background: var(--primary-orange);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

/* Location Hierarchy Display */
#hierarchy-content {
    background: linear-gradient(135deg, #fff 0%, var(--primary-orange-lightest) 100%);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid var(--primary-orange-lighter);
}

.hierarchy-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.hierarchy-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid var(--primary-orange-lighter);
    font-weight: 600;
    color: var(--primary-orange-dark);
}

.hierarchy-item.active {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
    box-shadow: 0 4px 15px rgba(255, 103, 37, 0.3);
}

.hierarchy-arrow {
    color: var(--primary-orange);
    font-size: 18px;
    font-weight: bold;
}

.hierarchy-details {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--primary-orange-lighter);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--primary-orange-lightest);
}

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

.detail-label {
    font-weight: 600;
    color: var(--dark-gray);
}

.detail-value {
    color: var(--primary-orange-dark);
    font-weight: 500;
}

/* Pagination */
.pagination {
    justify-content: center;
}

.page-link {
    color: var(--primary-orange);
    border-color: var(--primary-orange-lighter);
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 8px;
    font-weight: 600;
}

.page-link:hover {
    color: white;
    background-color: var(--primary-orange-light);
    border-color: var(--primary-orange-light);
}

.page-item.active .page-link {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
}

.page-item.disabled .page-link {
    color: var(--medium-gray);
    background-color: var(--light-gray);
    border-color: var(--primary-orange-lightest);
}

/* Results Count Badge */
#results-count {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-light) 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Page Size Selector */
#page-size {
    border: 2px solid var(--primary-orange-lighter);
    border-radius: 8px;
    padding: 5px 10px;
    color: var(--primary-orange-dark);
    font-weight: 600;
}

#page-size:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 37, 0.25);
}

/* Loading Indicator */
.spinner-border.text-orange {
    color: var(--primary-orange) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rera-search-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .rera-search-tab {
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .link-grid {
        grid-template-columns: 1fr;
    }
    
    .hierarchy-path {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .hierarchy-arrow {
        transform: rotate(90deg);
        margin: 5px 0;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 576px) {
    .rera-search-form input[type="text"] {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }
    
    .location-card {
        padding: 15px;
    }
    
    .location-name {
        font-size: 14px;
    }
    
    #hierarchy-content {
        padding: 15px;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card {
    animation: fadeInUp 0.4s ease-out;
}

/* Custom Scrollbar */
#search-suggestions::-webkit-scrollbar,
#directory-content::-webkit-scrollbar {
    width: 6px;
}

#search-suggestions::-webkit-scrollbar-track,
#directory-content::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

#search-suggestions::-webkit-scrollbar-thumb,
#directory-content::-webkit-scrollbar-thumb {
    background: var(--primary-orange-lighter);
    border-radius: 3px;
}

#search-suggestions::-webkit-scrollbar-thumb:hover,
#directory-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-orange);
}

/* Icons and Visual Enhancements */
.location-card .fa-solid {
    color: var(--primary-orange);
    margin-right: 8px;
}

.directory-item .fa-solid {
    color: var(--primary-orange);
    margin-right: 10px;
}

/* Hover Effects */
.location-card:hover .location-type {
    background: var(--primary-orange-dark);
    transform: scale(1.05);
}

.location-card:hover .location-code {
    background: var(--primary-orange-lightest);
    color: var(--primary-orange-darker);
}

/* Focus States for Accessibility */
.rera-search-tab:focus,
.location-card:focus {
    outline: 3px solid rgba(255, 103, 37, 0.3);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .rera-search-tabs,
    .rera-search-form,
    .pagination,
    #loading-indicator {
        display: none;
    }
    
    .location-card {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}