/**
 * RMRS Advanced Link Widget Styles
 * 
 * @package RMRS
 * @since 1.0.0
 */

.rmrs-advanced-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.rmrs-advanced-link .rmrs-link-icon {
    display: inline-flex;
    align-items: center;
}

.rmrs-advanced-link .rmrs-link-icon.icon-before {
    margin-right: 0.5em;
}

.rmrs-advanced-link .rmrs-link-icon.icon-after {
    margin-left: 0.5em;
}

/* Smooth scroll behavior */
.rmrs-advanced-link.smooth-scroll {
    scroll-behavior: smooth;
}

/* Icon-only mode - remove margins when icon is the only child */
.rmrs-advanced-link .rmrs-link-icon:only-child {
    margin: 0;
}

/* Ensure SVG icons inherit size and color properly */
.rmrs-advanced-link .rmrs-link-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

/**
 * RCBC Recyclepedia Widget Styles
 */

#recyclepedia-app {
    width: 100%;
    margin: 0 auto;
}

/* Map Container */
#recyclepedia-search-map {
    height: 400px;
    width: 100%;
    margin-bottom: 20px;
    background-color: #f0f0f0;
    /* Placeholder bg */
}

/* Form Groups */
.rcbc-form-group {
    margin-bottom: 15px;
}

.rcbc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

#recyclepedia-search-box,
.recyclepedia-search-area {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Button */
.form-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.form-button:hover {
    background-color: #1a252f;
}

/* Direction Panel Visibility Logic - REQUIRED */
#recyclepedia-map-direction-panel {
    display: none;
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #eee;
    background: #f9f9f9;
}

#recyclepedia-app.get-directions #recyclepedia-map-direction-panel {
    display: block;
}

/* Results & Messages */
#recyclepedia-search-results {
    margin-top: 20px;
}

#recyclepedia-app-message-panel {
    margin: 10px 0;
    font-style: italic;
    color: #666;
}

/* ========================================
   RECYCLING GUIDE WIDGET STYLES
   ======================================== */

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

/* Search Section */
.recycling-guide-container .search-container {
    max-width: 100%;
    margin: 0 auto;
}

.recycling-guide-container .search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.recycling-guide-container .search-input {
    flex: 1;
    padding: 16px 24px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.recycling-guide-container .search-input:focus {
    outline: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #0D98BA;
}

.recycling-guide-container .search-btn {
    padding: 16px 40px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recycling-guide-container .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    background: #1b5e20;
}

.recycling-guide-container .category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.recycling-guide-container .category-tag {
    padding: 10px 24px;
    background: #f0f4f8;
    color: #555;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid #e0e7ed;
    font-size: 14px;
}

.recycling-guide-container .category-tag:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    color: #333;
}

.recycling-guide-container .category-tag.active {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

/* Materials Grid */
.recycling-guide-container .materials-grid {
    display: block;
    position: relative;
    width: 100%;
    /* Min height to prevent collapse before load */
    min-height: 200px;
}

/* Material Card */
.recycling-guide-container .material-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    border: 2px solid transparent;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    /* Width will be set by JS usually, but set a default */
    width: 100%;
    box-sizing: border-box;
    will-change: transform, opacity;
}

.recycling-guide-container .material-card.hidden-material {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    z-index: -1;
}

.recycling-guide-container .material-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.recycling-guide-container .material-card.accepted {
    border-color: rgba(72, 186, 71, 0.2);
}

.recycling-guide-container .material-card.accepted:hover {
    border-color: rgba(72, 186, 71, 0.6);
}

.recycling-guide-container .material-card.not-accepted {
    border-color: rgba(220, 53, 69, 0.2);
    /* opacity: 0.85; */
}

.recycling-guide-container .material-card.not-accepted:hover {
    border-color: rgba(220, 53, 69, 0.6);
}

/* Location-based category tag colors */
.location-curbside {
    background: #0D98BA;
    color: white !important;
    border-color: #0a7a99;
}

.location-depot {
    background: #8b5cf6;
    color: white !important;
    border-color: #7c3aed;
}

.location-both {
    background: linear-gradient(135deg, #0D98BA 0%, #8b5cf6 100%);
    color: white !important;
    border: none;
}

.location-return {
    background: #f59e0b;
    color: white !important;
    border-color: #d97706;
}

.location-green-bin {
    background: #10b981;
    color: white !important;
    border-color: #059669;
}

.location-other {
    background: #6b7280;
    color: white !important;
    border-color: #4b5563;
}

/* Category overrides */
.category-organic {
    background: #10b981;
    color: white !important;
    border-color: #059669;
}

.recycling-guide-container .material-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.recycling-guide-container .material-icon-large {
    font-size: 48px;
    line-height: 1;
}

.recycling-guide-container .material-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recycling-guide-container .badge-accepted {
    background: #d4edda;
    color: #155724;
}

.recycling-guide-container .badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

.recycling-guide-container .material-name {
    font-size: 20px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 10px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recycling-guide-container .info-icon {
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.recycling-guide-container .info-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.recycling-guide-container .material-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.recycling-guide-container .material-details {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
    padding-bottom: 40px;
    margin-top: 16px;
}

.recycling-guide-container .detail-row {
    margin-bottom: 12px;
}

.recycling-guide-container .detail-row strong {
    display: block;
    color: #2e7d32;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.recycling-guide-container .detail-row p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.recycling-guide-container .location-text {
    font-weight: 600;
    color: #0D98BA;
}

.recycling-guide-container .material-category-tag {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Plastic Badges */
.recycling-guide-container .plastic-types-container {
    margin-top: 12px;
}

.recycling-guide-container .plastic-types-label {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    margin-right: 5px;
}

.recycling-guide-container .plastic-types-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.recycling-guide-container .plastic-chip {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.recycling-guide-container .plastic-chip:hover {
    background: #0ea5e9;
    color: white;
}

/* Modals */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.info-modal.active {
    display: flex;
}

.info-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.info-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f1f1;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.info-modal-close:hover {
    background: #e2e8f0;
    color: #333;
}

.info-modal-content h2 {
    color: #0A165C;
    /* var(--secondary-blue) */
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

/* Plastic Modal Specifics */
.plastic-modal-section {
    margin-bottom: 20px;
}

.plastic-modal-section strong {
    display: block;
    color: #2e7d32;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plastic-modal-section p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.plastic-modal-number {
    display: inline-block;
    background: #0D98BA;
    color: white;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    font-size: 16px;
    margin-right: 10px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No Results */
.recycling-guide-container .no-results {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    grid-column: 1 / -1;
}

.recycling-guide-container .no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.recycling-guide-container .no-results h3 {
    margin-top: 0;
    color: #333;
}