/* css/index.css */

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.pagination .page-link {
    color: var(--primary-color);
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color .3s;
    border: 1px solid #ddd;
    margin: 0 4px;
    border-radius: 4px;
}

.pagination .page-link.active {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.pagination .page-link:hover:not(.active) {
    background-color: #ddd;
}

.pagination .page-link-last {
    color: #dc3545; /* Red text */
    border-color: #f5c6cb;
    font-weight: bold;
    background-color: #fff;
}

.pagination .page-link-last.active {
    color: #dc3545;
    background-color: #fff;
    border-color: #f5c6cb;
}

.pagination .page-link-last:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Page Header */
main.container {
    padding-top: 14px;
}

.page-header {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 10px 0 28px;
    padding: 28px 30px 24px;
    border: 1px solid rgba(166, 205, 228, 0.42);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(61, 154, 255, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(87, 195, 145, 0.10), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 16px 38px rgba(35, 76, 112, 0.08);
    overflow: visible;
}

.page-header::after {
    content: "";
    position: absolute;
    left: 30px;
    bottom: 14px;
    width: 110px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2f80ed, #63c7b2);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-top h1 {
    margin: 0;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #24323d;
    text-wrap: balance;
    white-space: nowrap;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 50;
}

/* Search Container Styles */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.search-input {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.search-input:focus {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    width: 280px;
}

.search-input::placeholder {
    color: #999;
    font-size: 13px;
}

.clear-search-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Desktop specific search results info margin */
@media (min-width: 769px) {
    .search-results-info {
        margin-top: 8px !important;
    }
}

/* Public Link Header */
.public-link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 15px -20px; /* Negative margins to touch card edges */
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0; /* Only top corners rounded */
    border-left: 4px solid #667eea;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.public-link-header .shared-by {
    color: #495057;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-link-header .shared-by .user-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.public-link-header .shared-by strong {
    color: #667eea;
    font-weight: 600;
}

.public-link-header .link-date {
    color: #6c757d;
    font-size: 12px;
    font-weight: 400;
}

/* Link Actions & Favorites */
.link-actions button {
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.link-actions .favorite-btn {
    font-size: 38px;
}

.favorite-btn {
    background: none;
    border: none;
}

.favorite-file-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.file-no-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #315c9f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.favorites-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notice-content {
    flex: 1;
}

.notice-media-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-right: 18px;
}

.favorites-notice .btn-global-toggle {
    white-space: nowrap;
}

.favorites-notice a {
    font-weight: bold;
    color: #856404;
    text-decoration: underline;
}

/* Filters and Messages */
#filter-category-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px 30px 10px 15px;
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px;
    transition: border-color 0.2s ease-in-out;
}

#filter-category-select:hover {
    border-color: var(--primary-color);
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 200px;
    z-index: 60;
}

.custom-dropdown:has(.dropdown-selected.active) {
    z-index: 5000;
}

.dropdown-selected {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dropdown-selected:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.15);
}

.dropdown-selected.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    color: #6c757d;
}

.dropdown-selected.active .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5001;
    max-height: 250px;
    overflow-y: auto;
}

.dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option.selected {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.dropdown-option.selected:hover {
    background-color: var(--primary-hover);
}

/* Desktop Favorites Button Styling */
@media (min-width: 769px) {
    .btn-filter {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        background-color: #f8f9fa;
        color: #856404;
        border: 1px solid #ffd700;
        text-decoration: none;
    }
    
    .btn-filter.active {
        background: linear-gradient(135deg, #ffd700, #ffb300);
        color: #654321;
        border-color: #ffd700;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
        transform: translateY(-1px);
    }
    
    .btn-filter:hover {
        background: linear-gradient(135deg, #fff3cd, #ffe066);
        color: #856404;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(255, 215, 0, 0.25);
        border-color: #ffcc00;
    }
    
    .btn-filter.active:hover {
        background: linear-gradient(135deg, #ffcc00, #ff9900);
        color: #4a3728;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(255, 204, 0, 0.4);
    }

    .btn-filter.view-public {
        background: linear-gradient(135deg, #eef7ff, #d8ecff);
        color: #116aa3;
        border-color: #9fd3ff;
        box-shadow: 0 4px 12px rgba(21, 126, 204, 0.14);
    }

    .btn-filter.view-public:hover {
        background: linear-gradient(135deg, #dff0ff, #c7e5ff);
        color: #0d5b8d;
        border-color: #84c7ff;
    }

    .btn-filter.view-my {
        background: linear-gradient(135deg, #fff4db, #ffe6b0);
        color: #8a5a00;
        border-color: #ffcb66;
        box-shadow: 0 4px 12px rgba(255, 179, 40, 0.18);
    }

    .btn-filter.view-my:hover {
        background: linear-gradient(135deg, #ffefcc, #ffd98d);
        color: #744b00;
        border-color: #ffbd45;
    }
    
    /* Special styling for Reels button - Desktop */
    .btn-filter:has(.reels-icon) {
        background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
        color: white;
        border: 1px solid #ff6b35;
        font-weight: 600;
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
        position: relative;
        overflow: hidden;
    }
    
    .btn-filter:has(.reels-icon):hover {
        background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
        border-color: #f7931e;
    }
    
    .btn-filter:has(.reels-icon):active {
        transform: translateY(0);
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
    }
    
    .btn-filter:has(.reels-icon)::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .btn-filter:has(.reels-icon):hover::before {
        left: 100%;
    }
    
    .btn-filter .reels-icon {
        font-size: 16px;
        margin-right: 6px;
        animation: pulse 2s infinite;
    }
    
    .btn-filter .reels-text {
        font-weight: 600;
    }
    
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }
    
    /* Reels Button - Desktop (old styles - keeping for reference) */
    .btn-reels {
        background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
        color: white;
        padding: 12px 24px;
        border-radius: 25px;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
        border: none;
        cursor: pointer;
    }
    
    .btn-reels:hover {
        background: linear-gradient(135deg, #ff8f00 0%, #ff6f00 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
        color: white;
        text-decoration: none;
    }
    
    .btn-reels:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    }
    
    .reels-icon {
        font-size: 18px;
    }
    
    .reels-text {
        font-weight: 600;
    }
}

.no-links-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color-secondary);
    font-size: 1.1em;
}

/* Add word wrapping to URL and description paragraphs */
.link-card p,
.link-card h3 {
    overflow-wrap: break-word;
    word-break: break-word; /* For wider compatibility */
}

/* Link Card Specifics */
.link-card p:last-of-type {
    margin-bottom: 20px;
}

.link-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.link-actions-group {
    display: flex;
    gap: 10px;
}

.btn-details,
.btn-edit,
.btn-delete,
.btn-play-link {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.btn-details:hover,
.btn-edit:hover,
.btn-delete:hover,
.btn-play-link:hover {
    transform: translateY(-2px);
}

.btn-details {
    background-color: #17a2b8; /* Info Blue */
}
.btn-details:hover {
    background-color: #138496;
}

.btn-edit {
    background-color: #ffc107; /* Warning Yellow */
    color: #212529;
}
.btn-edit:hover {
    background-color: #e0a800;
}

.btn-play-link {
    background-color: #28a745;
    color: white;
}
.btn-play-link:hover {
    background-color: #218838;
}

.inline-play-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border: none;
    border-radius: 50%;
    background-color: #28a745;
    color: white;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}
.inline-play-link:hover {
    background-color: #218838;
}

.btn-delete {
    background-color: #dc3545; /* Danger Red */
}
.btn-delete:hover {
    background-color: #c82333;
}

/* Read More Description Styles - JS Controlled */
.read-more-toggle {
    cursor: pointer;
    color: #6c757d; /* Muted gray color, less prominent */
    font-weight: 500; /* Less bold, more subtle */
    display: inline-block; /* Ensures it flows with text */
    margin-left: 15px; /* More space to prevent accidental clicks */
    transition: color 0.2s ease; /* Smooth color transition on hover */
}

.read-more-toggle:hover {
    color: var(--primary-color); /* Show primary color on hover */
}

/* --- Specific styling for URL read-more toggle --- */
p[data-is-long-url] .read-more-toggle {
    font-size: 1.1em; /* Bigger than normal toggles */
    margin-left: 20px; /* More space for URLs */
    font-weight: 600; /* Slightly more prominent for URLs */
}



/* --- Description Container & Copy Button --- */
.link-description {
    position: relative;
}

/* Add padding to prevent text from going under the button ONLY when button exists */
.link-description.has-copy-btn {
    padding-right: 0; /* No longer needed */
}

/* --- NEW: Specific styling for the description's read-more toggle --- */
.link-description .read-more-toggle {
    font-size: 1.2em; /* Make it 20% larger than the surrounding text */
    font-weight: 500; /* Consistent with general toggle styling */
    vertical-align: middle; /* Ensure it aligns nicely with the copy button */
}

.btn-copy-description {
    /* Base style copied from URL copy button, but no absolute positioning */
    background-color: #eaf0f6; /* A very light, subtle blue */
    color: #4c6a8d;       /* A muted, readable blue for text */
    border: 1px solid #d8e1e9;
    padding: 0 5px;   /* Further reduced padding */
    font-size: 10px;      /* Further reduced font size */
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transition for all properties */
    vertical-align: middle; /* Align with text and other buttons */
    margin-left: 12px; /* Increased space from the text or other buttons */
    position: relative;
    overflow: hidden;
}

.btn-copy-description:hover {
    background-color: #d1e7dd; /* Subtle green tint on hover */
    color: #0f5132; /* Darker green text */
    border-color: #badbcc; /* Green border */
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */
}

.btn-copy-description:active {
    transform: translateY(0); /* Reset lift on click */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Smaller shadow on click */
}

.btn-copy-description.copied {
    background-color: #28a745; /* Green */
    color: white;
    border-color: #28a745;
}

/* --- NEW: Responsive Adjustments for Mobile --- */
@media (max-width: 768px) {
    main.container {
        padding-top: 10px !important;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        margin: 8px 0 18px;
        padding: 18px 16px 16px;
        border-radius: 18px;
    }

    .page-header::after {
        left: 16px;
        bottom: 10px;
        width: 72px;
        height: 3px;
    }

    .page-header h1 {
        font-size: clamp(1.8rem, 7vw, 2.35rem);
        line-height: 1;
    }

    .favorites-notice {
        flex-direction: column;
        align-items: flex-start;
        gap: 0px;
    }
    
    .notice-content {
        text-align: left;
        width: 100%;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .notice-media-toggles {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .notice-content p {
        margin: 0;
        padding: 0;
    }
    
    .search-container {
        align-self: flex-end;
        display: flex;
        align-items: center;
        gap: 5px;
        margin-top: -20px;
        padding-top: 0;
    }
    
    .search-input {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 20px;
        padding: 6px 12px;
        font-size: 12px;
        width: 120px;
        outline: none;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .search-input:focus {
        border-color: #3498db;
        box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
        width: 140px;
    }
    
    .search-input::placeholder {
        color: #999;
        font-size: 11px;
    }
    
    .clear-search-btn {
        background: #e74c3c;
        color: white;
        border: none;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .clear-search-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
    }
    
    /* Mobile responsive for public header */
    .public-link-header {
        margin: -12px -12px 15px -12px; /* Adjust for mobile card padding */
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .public-link-header .shared-by {
        font-size: 12px;
    }
    
    .public-link-header .shared-by .user-avatar {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid #e9ecef;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    
    /* Shorten the category name on mobile */
    .public-link-header .shared-by .category-name {
        max-width: 17ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    
    /* Shorten the username on mobile */
    .public-link-header .shared-by .username {
        max-width: 5ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    
    .public-link-header .link-date {
        font-size: 11px;
    }

    /* Custom Dropdown - Mobile - Make Much Smaller */
    .custom-dropdown {
        min-width: 100px; /* Reduced from 130px */
    }
    
    .dropdown-selected {
        padding: 4px 8px; /* Reduced from 6px 10px */
        font-size: 11px; /* Reduced from 13px */
    }
    
    .dropdown-arrow {
        width: 6px; /* Reduced from 8px */
        height: 6px; /* Reduced from 8px */
    }
    
    .dropdown-option {
        padding: 6px 8px; /* Reduced from 8px 10px */
        font-size: 11px; /* Reduced from 13px */
    }
    
    .dropdown-options {
        max-height: 160px; /* Reduced from 180px */
    }
    
    /* Show Favorites Button - Mobile - Much Smaller */
    .btn-filter {
        padding: 1px 8px !important; /* Reduced vertical padding */
        font-size: 11px !important; /* Reduced from 13px */
        border-radius: 4px; /* Reduced from 6px */
        min-height: 20px; /* Reduced from 24px */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        transition: all 0.3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        background-color: #f8f9fa;
        color: #856404;
        border: 1px solid #ffd700;
        text-decoration: none;
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    .btn-filter.active {
        background: linear-gradient(135deg, #ffd700, #ffb300);
        color: #654321;
        border-color: #ffd700;
        font-weight: 600;
        box-shadow: 0 3px 8px rgba(255, 215, 0, 0.4);
    }
    
    .btn-filter:hover {
        background: linear-gradient(135deg, #fff3cd, #ffe066);
        color: #856404;
        transform: scale(0.95);
        box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
        border-color: #ffcc00;
    }
    
    .btn-filter.active:hover {
        background: linear-gradient(135deg, #ffcc00, #ff9900);
        color: #4a3728;
        transform: scale(0.95);
        box-shadow: 0 4px 12px rgba(255, 204, 0, 0.5);
    }
    
    /* Special styling for Reels button - Mobile */
    .btn-filter:has(.reels-icon) {
        background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
        color: white;
        border: 1px solid #ff6b35;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
        position: relative;
        overflow: hidden;
    }
    
    .btn-filter:has(.reels-icon):hover {
        background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
        color: white;
        transform: scale(0.95);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
        border-color: #f7931e;
    }
    
    .btn-filter:has(.reels-icon):active {
        transform: scale(0.9);
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
    }
    
    .btn-filter:has(.reels-icon)::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.3s ease;
    }
    
    .btn-filter:has(.reels-icon):hover::before {
        left: 100%;
    }
    
    .btn-filter .reels-icon {
        font-size: 14px;
        margin-right: 4px;
        animation: pulse 2s infinite;
    }
    
    .btn-filter .reels-text {
        font-weight: 600;
    }
    
    /* Add New Link Button - Mobile - Much Smaller */
    #add-link-btn {
        padding: 1px 8px !important; /* Reduced vertical padding */
        font-size: 11px !important; /* Reduced from 13px */
        border-radius: 4px; /* Reduced from 6px */
        min-height: 20px; /* Reduced from 24px */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        transition: all 0.3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        background-color: var(--primary-color);
        color: white;
        border: 1px solid var(--primary-color);
        text-decoration: none;
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    #add-link-btn:hover {
        background-color: var(--primary-hover);
        transform: scale(0.95);
        box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    }

    /* Page Actions Container - Better Mobile Layout */
    .page-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px; /* Reduced gap between items */
        align-items: center;
        justify-content: flex-end; /* Align to right */
    }

    /* Pagination Mobile Styles */
    .pagination {
        padding: 15px 0; /* Reduce vertical padding */
    }
    
    .pagination .page-link {
        padding: 6px 10px; /* Smaller padding for mobile */
        font-size: 14px; /* Smaller font size */
        margin: 0 2px; /* Reduce margin between buttons */
        border-radius: 3px; /* Slightly smaller border radius */
    }
    
    .pagination .page-link-last {
        padding: 6px 10px; /* Same as regular page links */
        font-size: 14px; /* Consistent font size */
    }
    
    .btn-copy-description {
        margin-left: 23px; /* Even more space on mobile */
    }
    
    /* Make all read-more toggle buttons smaller on mobile */
    .read-more-toggle {
        font-size: 1.0em !important; /* Smaller on mobile */
        font-weight: 500 !important; /* Lighter weight */
    }
    
    /* URL toggle button adjustments for mobile */
    p[data-is-long-url] .read-more-toggle {
        font-size: 1.2em !important; /* Smaller than desktop but still bit bigger than others */
        margin-left: 25px !important;; /* Even more space on mobile */
        font-weight: 500 !important; /* Keep slightly bolder for URLs */
    }
    
    /* Description toggle button adjustments for mobile */
    .link-description .read-more-toggle {
        font-size: 1.2em !important; /* Slightly bigger for better visibility */
        font-weight: 500 !important; /* Lighter weight */
    }
    
    /* Completely disable all effects for favorite button on mobile */
    .favorite-btn {
        transform: none !important; 
        transition: none !important; /* Remove all transitions */
        outline: none !important; 
        box-shadow: none !important; 
        border: none !important; 
        background: none !important; 
        -webkit-tap-highlight-color: transparent !important; 
        -webkit-touch-callout: none !important; 
        -webkit-user-select: none !important; 
        user-select: none !important; 
    }
    
    /* Light feedback effect for mobile touch */
    .favorite-btn:active {
        transform: scale(0.95) !important; /* Slight shrink on tap */
        opacity: 0.7 !important; /* Slight fade on tap */
        transition: all 0.1s ease !important; /* Quick feedback */
    }
    
    /* Remove other effects but keep the active feedback */
    .favorite-btn:hover,
    .favorite-btn:focus,
    .favorite-btn:visited {
        transform: none !important;
        text-shadow: none !important; 
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
        transition: none !important; 
        /* DO NOT override color - let JavaScript handle it */
    }
    
    /* For favorited items, keep the yellow color working */
    .favorite-btn.favorited:active {
        transform: scale(0.95) !important; /* Same feedback for favorited */
        opacity: 0.7 !important; /* Same fade effect */
        transition: all 0.1s ease !important; /* Quick feedback */
    }
    
    .favorite-btn.favorited:hover,
    .favorite-btn.favorited:focus {
        transform: none !important;
        text-shadow: none !important; 
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
        transition: none !important;
        /* DO NOT override color - let JavaScript handle it */
    }
    
    /* Mobile optimized action buttons - Details, Edit, Delete */
    .btn-details,
    .btn-edit,
    .btn-delete,
    .btn-play-link {
        padding: 6px 8px !important; /* Reduced padding for mobile */
        font-size: 12px !important; /* Smaller font size */
        font-weight: 500 !important; /* Consistent weight */
        border-radius: 4px !important; /* Slightly smaller radius */
        margin: 2px !important; /* Small margin between buttons */
        min-width: 50px !important; /* Minimum width for better touch targets */
        text-align: center !important; /* Center align text */
    }
    
    /* Special sizing for longer button texts */
    .btn-details {
        padding: 6px 10px !important; /* More padding for longer text */
        min-width: 48px !important; /* Optimal narrow width for Details */
    }
    
    .btn-delete {
        padding: 6px 10px !important; /* More padding for longer text */
        min-width: 58px !important; /* Optimal width for Delete */
    }
    
    /* Edit button - Special sizing for Visit Link text */
    .btn-edit {
        min-width: 65px !important; /* Wider for "Visit Link" text */
        white-space: nowrap !important; /* Prevent text wrapping */
    }
    
    /* Remove hover transform effects on mobile */
    .btn-details:hover,
    .btn-edit:hover,
    .btn-delete:hover,
    .btn-play-link:hover {
        transform: none !important; /* No lift effect on mobile */
    }
    
    /* Ensure buttons stack nicely on very small screens */
    .link-actions-group {
        gap: 5px !important; /* Reduced gap between buttons */
        flex-wrap: wrap !important; /* Allow wrapping if needed */
    }
    
    /* Optional: Make buttons full width on very small screens */
    @media (max-width: 480px) {
        /* Extra Small Mobile Dropdown - Even Smaller */
        .custom-dropdown {
            min-width: 85px; /* Reduced from 110px */
        }
        
        .dropdown-selected {
            padding: 3px 6px; /* Reduced from 5px 8px */
            font-size: 10px; /* Reduced from 12px */
        }
        
        .dropdown-arrow {
            width: 5px; /* Reduced from 7px */
            height: 5px; /* Reduced from 7px */
        }
        
        .dropdown-option {
            padding: 5px 6px; /* Reduced from 7px 8px */
            font-size: 10px; /* Reduced from 12px */
        }
        
        .dropdown-options {
            max-height: 140px; /* Reduced from 160px */
        }
        
        /* Show Favorites Button - Extra Small Mobile - Even Smaller */
        .btn-filter {
            padding: 0px 6px !important; /* Reduced vertical padding */
            font-size: 10px !important; /* Reduced from 12px */
            min-height: 18px; /* Reduced from 22px */
        }
        
        /* Add New Link Button - Extra Small Mobile - Even Smaller */
        #add-link-btn {
            padding: 0px 6px !important; /* Reduced vertical padding */
            font-size: 10px !important; /* Reduced from 12px */
            min-height: 18px; /* Reduced from 22px */
        }

        /* Page Actions Container - Tighter Layout for Very Small Screens */
        .page-actions {
            gap: 4px; /* Even smaller gap */
        }
    
        .btn-details,
        .btn-edit,
        .btn-delete,
        .btn-play-link {
            flex: 1 !important; /* Equal width buttons */
            min-width: 0 !important; /* Allow shrinking */
            font-size: 11px !important; /* Even smaller font */
            padding: 5px 4px !important; /* Even smaller padding */
        }
        
        /* Special sizing for longer button texts on small screens */
        .btn-details {
            padding: 5px 6px !important; /* More padding for longer text */
            min-width: 38px !important; /* Optimal narrow width for Details */
        }
        
        .btn-delete {
            padding: 5px 6px !important; /* More padding for longer text */
            min-width: 48px !important; /* Optimal width for Delete */
        }
        
        /* Edit button - Special sizing for Visit Link on small screens */
        .btn-edit {
            min-width: 55px !important; /* Wider for "Visit Link" text */
            white-space: nowrap !important; /* Prevent text wrapping */
            font-size: 10px !important; /* Smaller font to fit better */
        }

        .btn-play-link {
            min-width: 42px !important;
            white-space: nowrap !important;
            font-size: 10px !important;
        }
    }
}

/* --- Media Section Layout & Toggle --- */
.media-header {
    margin-top: 15px; /* Give some space from the description */
    margin-bottom: 10px;
}

h5.media-title {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #555;
}

.media-count {
    font-weight: 300; /* Make it even lighter */
    font-size: 0.8em; /* Make it slightly smaller */
    color: #6c757d; /* A neutral grey color */
    margin-left: 8px; /* Space from the title */
}

.toggle-media-title {
    cursor: pointer;
    transition: color 0.2s ease;
    width: fit-content; /* Make only the text area clickable */
    display: flex; /* Flex container for proper alignment */
    align-items: center; /* Vertically center items */
}

/* --- Specific colors for media toggles --- */
.toggle-media-title.toggle-images {
    color: #17a2b8; /* Info Blue */
}
.toggle-media-title.toggle-videos {
    color: #d35400; /* A strong orange */
}

.toggle-media-title:hover {
    color: var(--primary-color); /* Default hover, primarily for Images */
}

/* Specific hover color for the video toggle */
.toggle-media-title.toggle-videos:hover {
    color: #28a745; /* A distinct, vibrant green for hover */
}

/* More specific selector to override potential conflicts */
.link-card .media-collapsible {
    display: none;
}

.media-collapsible.visible {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.url-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
}

.url-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.url-line p {
    margin: 0;
    flex: 1;
}

.btn-privacy-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    line-height: 1;
    color: #6c757d;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}



/* Status-specific styling */
.btn-privacy-toggle.pending-status {
    color: #ffc107;
    animation: pulse-pending 2s infinite;
}

.btn-privacy-toggle.public-status {
    color: #28a745;
}

.btn-privacy-toggle.private-status {
    color: #6c757d;
}

@keyframes pulse-pending {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.btn-privacy-toggle:hover {
    transform: scale(1.1);
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    margin: 8px;
    opacity: 0;
    transform: translateY(100%);
    animation: slideIn 0.3s ease forwards;
}

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

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

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

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@media screen and (max-width: 768px) {
    .btn-privacy-toggle {
        font-size: 20px;
    }

    #toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        margin: 4px;
        text-align: center;
    }
    
    /* Reels Button - Mobile */
    .btn-reels {
        background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        text-decoration: none;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
        border: none;
        cursor: pointer;
    }
    
    .btn-reels:hover {
        background: linear-gradient(135deg, #ff8f00 0%, #ff6f00 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
        color: white;
        text-decoration: none;
    }
    
    .btn-reels:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    }
    
    .reels-icon {
        font-size: 16px;
    }
    
    .reels-text {
        font-weight: 600;
    }
} 
