/* ===== UPDATED STYLES FOR VERSION 6.0 - FULLY MOBILE RESPONSIVE ===== */

/* General Responsive Container */
.rcd-urls-section,
.rcd-categories-wrapper {
    margin: 30px 0;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.rcd-urls-section::before,
.rcd-categories-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, currentColor, transparent);
    z-index: 1;
}

/* Related Posts Section */
.rcd-related-section {
    border-color: #F43676;
    color: #F43676;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

/* References Section */
.rcd-reference-section {
    border-color: #6f42c1;
    color: #6f42c1;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

/* Categories Section */
.rcd-categories-wrapper {
    border-color: #F43676;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

/* Headers - Fully Responsive */
.rcd-urls-header,
.rcd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.rcd-urls-title,
.rcd-main-heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.rcd-urls-title::before {
    content: '🔗';
    font-size: 24px;
}

.rcd-main-heading::before {
    content: '📁';
    font-size: 24px;
}

/* View All Button - Same line as heading on mobile */
.rcd-view-all-btn {
    background: linear-gradient(135deg, #F43676, #ff5a9c);
    color: white !important;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 3px 10px rgba(244, 54, 118, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.rcd-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 54, 118, 0.4);
    background: linear-gradient(135deg, #ff5a9c, #F43676);
}

/* URLs Containers */
.rcd-urls-container {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

/* Categories Container */
.rcd-categories-container {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

/* URL Items */
.rcd-url-item-front {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    width: 100%;
}

.rcd-url-item-front:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.rcd-url-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
    color: #333;
    gap: 12px;
    transition: all 0.3s ease;
    width: 100%;
}

.rcd-url-link:hover {
    color: inherit;
    text-decoration: none !important;
}

.rcd-url-icon {
    font-size: 20px;
    color: inherit;
    flex-shrink: 0;
}

.rcd-url-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Category Items */
.rcd-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    text-decoration: none !important;
    box-shadow: none !important;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
}

.rcd-category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
    text-decoration: none !important;
}

/* Selected categories */
.rcd-category-item.rcd-selected {
    background: linear-gradient(135deg, rgba(244, 54, 118, 0.1) 0%, rgba(244, 54, 118, 0.05) 100%);
    border-color: #F43676;
}

.rcd-category-item.rcd-selected .rcd-category-icon {
    color: #F43676;
    transform: scale(1.2);
}

.rcd-category-item.rcd-selected .rcd-category-name {
    color: #F43676;
    font-weight: 600;
}

/* Related categories */
.rcd-category-item.rcd-related {
    background: white;
    border: 1px solid #e0e0e0;
}

.rcd-category-item.rcd-related:hover {
    border-color: #F43676;
}

.rcd-category-item.rcd-related .rcd-category-icon {
    color: #666;
}

.rcd-category-item.rcd-related .rcd-category-name {
    color: #333;
}

/* Category icon */
.rcd-category-icon {
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Category name */
.rcd-category-name {
    flex: 1;
    font-size: 15px;
    transition: all 0.3s ease;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Selected indicator */
.rcd-selected-indicator {
    color: #F43676;
    font-weight: bold;
    font-size: 16px;
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #F43676;
    box-shadow: 0 2px 5px rgba(244, 54, 118, 0.3);
    flex-shrink: 0;
}

/* Display mode indicator */
.rcd-mode-indicator {
    background: rgba(244, 54, 118, 0.1);
    color: #F43676;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    display: inline-block;
    border: 1px solid rgba(244, 54, 118, 0.3);
    width: 100%;
    box-sizing: border-box;
}

/* ===== PAGINATION STYLES ===== */
.rcd-pagination,
.rcd-urls-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.rcd-page-btn {
    background: #f5f5f5;
    color: #333;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.rcd-page-btn:hover {
    background: #F43676;
    color: white;
    border-color: #F43676;
}

.rcd-page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.rcd-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: #f5f5f5;
    color: #333;
    border-radius: 50%;
    text-decoration: none !important;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.rcd-page-link:hover {
    background: #F43676;
    color: white;
}

.rcd-current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: #F43676;
    color: white;
    border-radius: 50%;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Desktop - Large Screens (1200px and above) */
@media (min-width: 1200px) {
    .rcd-categories-container,
    .rcd-related-section .rcd-urls-container,
    .rcd-reference-section .rcd-urls-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rcd-header,
    .rcd-urls-header {
        flex-wrap: nowrap;
    }
}

/* Desktop - Medium Screens (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .rcd-categories-container,
    .rcd-related-section .rcd-urls-container,
    .rcd-reference-section .rcd-urls-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet - Portrait (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        padding: 18px;
        margin: 25px 0;
    }
    
    .rcd-categories-container,
    .rcd-related-section .rcd-urls-container,
    .rcd-reference-section .rcd-urls-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rcd-urls-title,
    .rcd-main-heading {
        font-size: 20px;
    }
    
    .rcd-view-all-btn {
        padding: 9px 18px;
        font-size: 13px;
    }
}

/* Mobile - Landscape (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        padding: 15px;
        margin: 20px 0;
    }
    
    .rcd-categories-container,
    .rcd-related-section .rcd-urls-container,
    .rcd-reference-section .rcd-urls-container {
        grid-template-columns: 1fr;
    }
    
    .rcd-header,
    .rcd-urls-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    .rcd-urls-title,
    .rcd-main-heading {
        font-size: 18px;
        min-width: 150px;
    }
    
    .rcd-view-all-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .rcd-category-item,
    .rcd-url-link {
        padding: 12px 16px;
    }
    
    .rcd-pagination,
    .rcd-urls-pagination {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Mobile - Portrait (up to 575px) */
@media (max-width: 575px) {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        padding: 12px;
        margin: 15px 0;
        border-width: 1px;
    }
    
    .rcd-categories-container,
    .rcd-related-section .rcd-urls-container,
    .rcd-reference-section .rcd-urls-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .rcd-header,
    .rcd-urls-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rcd-urls-title,
    .rcd-main-heading {
        font-size: 18px;
        width: 100%;
        justify-content: space-between;
    }
    
    .rcd-view-all-btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 14px;
    }
    
    /* More Categories and View All on same line */
    .rcd-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .rcd-main-heading {
        font-size: 16px;
        min-width: auto;
        flex: 1;
        margin-right: 10px;
    }
    
    .rcd-view-all-btn {
        width: auto;
        padding: 8px 15px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .rcd-category-item,
    .rcd-url-link {
        padding: 10px 14px;
        min-height: 50px;
    }
    
    .rcd-category-icon {
        font-size: 18px;
    }
    
    .rcd-category-name,
    .rcd-url-text {
        font-size: 14px;
    }
    
    .rcd-pagination,
    .rcd-urls-pagination {
        flex-direction: column;
        gap: 10px;
        padding-top: 15px;
        margin-top: 20px;
    }
    
    .rcd-page-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
    
    .rcd-page-numbers {
        gap: 6px;
    }
    
    .rcd-page-link,
    .rcd-current-page {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 14px;
    }
    
    .rcd-mode-indicator {
        font-size: 12px;
        padding: 6px 12px;
        text-align: center;
    }
}

/* Small Mobile (up to 360px) */
@media (max-width: 360px) {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        padding: 10px;
        margin: 12px 0;
    }
    
    .rcd-main-heading {
        font-size: 15px;
        gap: 5px;
    }
    
    .rcd-main-heading::before {
        font-size: 20px;
    }
    
    .rcd-view-all-btn {
        padding: 7px 12px;
        font-size: 11px;
        gap: 5px;
    }
    
    .rcd-category-item {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .rcd-category-icon {
        font-size: 16px;
    }
    
    .rcd-category-name {
        font-size: 13px;
    }
    
    .rcd-selected-indicator {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .rcd-view-all-btn {
        display: none;
    }
    
    .rcd-url-link::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .rcd-category-item,
    .rcd-url-item-front,
    .rcd-view-all-btn,
    .rcd-page-btn,
    .rcd-page-link {
        transition: none !important;
        transform: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rcd-urls-section,
    .rcd-categories-wrapper {
        border-width: 3px;
    }
    
    .rcd-category-item.rcd-selected {
        border-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .rcd-categories-wrapper,
    .rcd-urls-section {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .rcd-category-item.rcd-related {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .rcd-url-item-front {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .rcd-category-name,
    .rcd-url-text {
        color: #f0f0f0;
    }
    
    .rcd-page-btn {
        background: #444;
        color: #f0f0f0;
        border-color: #555;
    }
}

/* Fix for WordPress Themes */
.alignwide .rcd-categories-wrapper,
.alignfull .rcd-categories-wrapper,
.alignwide .rcd-urls-section,
.alignfull .rcd-urls-section {
    max-width: 100% !important;
    width: 100% !important;
}

/* Ensure full width in content area */
.entry-content .rcd-categories-wrapper,
.entry-content .rcd-urls-section,
.post-content .rcd-categories-wrapper,
.post-content .rcd-urls-section {
    width: 100%;
    max-width: 100%;
}

/* Animation for hover effects */
@keyframes rcdPulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 54, 118, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(244, 54, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 54, 118, 0); }
}

.rcd-category-item.rcd-selected:hover {
    animation: rcdPulse 1.5s infinite;
}

/* Loading States */
.rcd-loading {
    opacity: 0.7;
    pointer-events: none;
}

.rcd-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Error States */
.rcd-error {
    border-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

/* Success States */
.rcd-success {
    border-color: #28a745 !important;
    background: rgba(40, 167, 69, 0.05) !important;
}