/* ValorMate - Profiles Styles */
/* Profile Header - Compact Design */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: transparent;
    border: none;
}

.profile-header h2 {
    display: none;
    /* Remove the header text */
}

.profile-actions {
    display: flex;
    gap: var(--space-sm);
    width: 100%;
}

.profile-actions .btn-primary {
    flex: 1;
    padding: var(--space-sm);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-actions .btn-secondary {
    padding: var(--space-sm);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Specific styling for Edit My Profile button */
#edit-my-profile-btn {
    background-color: var(--primary);
    color: white;
}

/* Specific styling for Filters button */
#toggle-filters-btn {
    background-color: rgba(236, 232, 225, 0.1);
    color: var(--text);
    border: 1px solid rgba(236, 232, 225, 0.2);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .profile-actions {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .profile-actions .btn-primary,
    .profile-actions .btn-secondary {
        width: 100%;
    }
}

/* Profile View Container */
#profiles-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Filters Panel - Restored to full width */
.filters-panel {
    background-color: rgba(17, 17, 17, 0.5);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255, 70, 85, 0.2);
    transition: all var(--transition);
}

/* Profiles Grid Container */
.profiles-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-md);
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding-right: var(--space-md);
    padding-bottom: var(--space-lg);
}

/* Custom scrollbar for profiles grid */
.profiles-grid-container::-webkit-scrollbar {
    width: 10px;
}

.profiles-grid-container::-webkit-scrollbar-track {
    background: rgba(17, 17, 17, 0.5);
    border-radius: 4px;
}

.profiles-grid-container::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

.profiles-grid-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-dark);
}

/* Pagination Container */
.pagination {
    flex-shrink: 0;
    margin: var(--space-lg) 0;
}

/* Profile Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
}

.profile-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Filters Panel - Updated for Scrollability */
.filters-panel {
    background-color: rgba(17, 17, 17, 0.5);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255, 70, 85, 0.2);
    transition: all var(--transition);

    /* New scrollability styles */
    max-height: 50vh;
    /* Limit height to 50% of the viewport height */
    overflow-y: auto;
    /* Enable vertical scrolling */
    overscroll-behavior: contain;
    /* Prevent scroll bounce */
    position: relative;
    /* Ensure proper positioning */
    z-index: 10;
    /* Ensure it's above other content */
}

/* Custom scrollbar for filters panel */
.filters-panel::-webkit-scrollbar {
    width: 8px;
}

.filters-panel::-webkit-scrollbar-track {
    background: rgba(17, 17, 17, 0.5);
    border-radius: 4px;
}

.filters-panel::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

.filters-panel::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-dark);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-right: var(--space-sm);
    /* Make room for scrollbar */
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.filter-item {
    flex: 1;
    min-width: 150px;
}

.filter-item label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.search-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.search-item {
    display: flex;
    gap: var(--space-sm);
    flex: 2;
}

.filter-buttons {
    display: flex;
    gap: var(--space-sm);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filters-panel {
        max-height: 70vh;
        /* More height on smaller screens */
    }
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    margin-top: var(--space-lg);
    padding: 0 var(--space-md);
}

.profile-card {
    background-color: rgba(17, 17, 17, 0.7);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

.profile-header {
    position: relative;
    padding: 0;
    margin: 0;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, rgba(31, 35, 38, 0.8), rgba(17, 17, 17, 0.9));
    border-bottom: 2px solid rgba(255, 70, 85, 0.3);
}

.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 70, 85, 0.7);
    box-shadow: 0 0 15px rgba(255, 70, 85, 0.5);
}

.profile-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: bold;
}

/* Rank-specific colors */
.rank-iron {
    background-color: rgba(93, 93, 93, 0.8);
}

.rank-bronze {
    background-color: rgba(175, 106, 65, 0.8);
}

.rank-silver {
    background-color: rgba(140, 170, 179, 0.8);
}

.rank-gold {
    background-color: rgba(229, 190, 58, 0.8);
}

.rank-platinum {
    background-color: rgba(86, 166, 184, 0.8);
}

.rank-diamond {
    background-color: rgba(176, 81, 243, 0.8);
}

.rank-ascendant {
    background-color: rgba(24, 168, 118, 0.8);
}

.rank-immortal {
    background-color: rgba(225, 33, 76, 0.8);
}

.rank-radiant {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.8), rgba(255, 140, 0, 0.8));
}

.profile-body {
    padding: var(--space-md);
}

.profile-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
    background-color: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.tag-region {
    background-color: rgba(86, 150, 255, 0.2);
    color: #56C1FF;
}

.tag-role {
    background-color: rgba(255, 70, 85, 0.2);
    color: #FF9A9A;
}

.tag-style {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFDF87;
}

.tag-level {
    background-color: rgba(76, 175, 80, 0.2);
    color: #90EE90;
}

.tag-mic {
    background-color: rgba(156, 39, 176, 0.2);
    color: #D7A1E7;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

#pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Profile details modal enhancements */
.profile-details-header {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-details-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.profile-details-info {
    flex: 1;
}

.profile-details-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--primary);
}

.profile-details-id {
    font-size: var(--font-size-md);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.discord-tag {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: rgba(88, 101, 242, 0.2);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    width: fit-content;
    margin-bottom: var(--space-sm);
}

.social-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition);
}

.twitter {
    background-color: rgba(29, 161, 242, 0.2);
    color: #1DA1F2;
}

.twitter:hover {
    background-color: rgba(29, 161, 242, 0.3);
}

.twitch {
    background-color: rgba(145, 70, 255, 0.2);
    color: #9146FF;
}

.twitch:hover {
    background-color: rgba(145, 70, 255, 0.3);
}

.instagram {
    background-color: rgba(193, 53, 132, 0.2);
    color: #E1306C;
}

.instagram:hover {
    background-color: rgba(193, 53, 132, 0.3);
}

.profile-details-bio {
    background-color: rgba(0, 0, 0, 0.2);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-lg);
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.5;
}

.profile-details-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.profile-details-section {
    background-color: rgba(0, 0, 0, 0.2);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
}

.profile-details-section h4 {
    color: var(--primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(255, 70, 85, 0.3);
}

.profile-details-items {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
}

.profile-item-label {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.profile-item-value {
    color: var(--text);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    background-color: #5865F2;
    /* Discord color */
    color: white;
    border: none;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition);
}

.contact-button:hover {
    background-color: #4752C4;
}

/* Profile photo uploader */
.profile-photo-uploader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

#profile-photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

#profile-photo-input {
    display: none;
    /* Hide the actual file input */
}

/* Loading and empty states */
.profile-loading,
.profiles-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

/* Checkbox styling */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: var(--space-xs);
}

/* Guest restriction modal */
#guest-restriction-modal .modal-body {
    text-align: center;
}

#guest-restriction-modal p {
    margin-bottom: var(--space-md);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-details-sections {
        grid-template-columns: 1fr;
    }

    .profile-details-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .discord-tag,
    .social-links {
        justify-content: center;
        margin: 0 auto;
        margin-bottom: var(--space-sm);
    }

    .profiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Empty placeholder for default photo in case it's missing */
img.profile-photo[src=""],
img.profile-photo:not([src]) {
    background-color: rgba(255, 70, 85, 0.2);
    position: relative;
}

img.profile-photo[src=""]:after,
img.profile-photo:not([src]):after {
    content: "No Photo";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* For profile-less state */
.create-profile-prompt {
    text-align: center;
    padding: var(--space-xl);
    background-color: rgba(255, 70, 85, 0.1);
    border: 1px solid rgba(255, 70, 85, 0.3);
    border-radius: var(--radius-md);
    margin: var(--space-xl) auto;
    max-width: 600px;
}

.create-profile-prompt h3 {
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.create-profile-prompt p {
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
    line-height: 1.5;
}