/* ============================================
   Pingstr - Profile Page Styles
   ============================================ */

.profile-page {
    padding: 0;
}

/* ============================================
   PROFILE HEADER
   ============================================ */

.profile-header {
    position: relative;
    margin-bottom: 24px;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-cover-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.profile-cover:hover .edit-cover-btn {
    opacity: 1;
}

.profile-info-container {
    max-width: 935px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 32px;
}

.profile-avatar-section {
    margin-top: -60px;
    z-index: 1;
}

.profile-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
    background: var(--bg-secondary);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.edit-avatar-btn:hover {
    transform: scale(1.1);
}

/* Profile Details */
.profile-details {
    flex: 1;
    padding-top: 24px;
}

.profile-name-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-name-section h1 {
    font-size: 28px;
    font-weight: 700;
}

.username {
    color: var(--text-secondary);
    font-size: 16px;
}

.verified-badge {
    color: var(--secondary);
    font-size: 20px;
}

.verified-badge.official {
    color: var(--primary);
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
    max-width: 500px;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 12px;
}

.profile-actions .btn-secondary {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   PROFILE TABS
   ============================================ */

.profile-tabs {
    max-width: 935px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

.tab-btn i {
    font-size: 16px;
}

/* ============================================
   PROFILE CONTENT
   ============================================ */

.profile-content {
    max-width: 935px;
    margin: 0 auto;
    padding: 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    aspect-ratio: 9/16;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail img,
.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.video-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-stats {
    display: flex;
    gap: 12px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.thumbnail-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Thumbnail Delete Button */
.thumbnail-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 10;
}

.video-thumbnail:hover .thumbnail-delete-btn {
    opacity: 1;
}

.thumbnail-delete-btn:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ============================================
   SAVED SUB-TABS & SOUNDS
   ============================================ */

.saved-sub-tabs {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.saved-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.saved-tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.saved-tab-btn.active {
    background: var(--primary);
    color: white;
}

.saved-content {
    grid-column: 1 / -1;
}

.saved-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.saved-sounds-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-sound-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.saved-sound-item:hover {
    background: var(--bg-tertiary);
}

.saved-sound-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #9333ea);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.saved-sound-info {
    flex: 1;
    min-width: 0;
}

.saved-sound-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-sound-artist {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-sound-actions {
    display: flex;
    gap: 8px;
}

.saved-sound-actions button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.saved-sound-actions button:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   EDIT PROFILE MODAL
   ============================================ */

.edit-profile-modal {
    padding: 20px;
    align-items: center;
    overflow-y: auto;
}

.edit-profile-modal .modal-content {
    max-width: 500px;
    max-height: calc(100vh - 40px);
    border-radius: var(--radius-xl);
    overflow-y: auto;
    margin: auto;
}

.edit-profile-modal form {
    padding: 24px;
    overflow-y: auto;
}

.edit-profile-modal .form-group {
    margin-bottom: 20px;
}

.edit-profile-modal label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.edit-profile-modal input,
.edit-profile-modal textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.edit-profile-modal input:focus,
.edit-profile-modal textarea:focus {
    border-color: var(--primary);
}

.edit-profile-modal textarea {
    resize: none;
    height: 100px;
}

.input-prefix {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.input-prefix:focus-within {
    border-color: var(--primary);
}

.input-prefix span {
    padding: 12px 0 12px 16px;
    color: var(--text-muted);
}

.input-prefix input {
    border: none;
    background: none;
    padding-left: 4px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .profile-cover {
        height: 150px;
    }
    
    .profile-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-avatar-section {
        margin-top: -50px;
    }
    
    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .profile-details {
        padding-top: 16px;
    }
    
    .profile-name-section {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .profile-name-section h1 {
        font-size: 22px;
        width: 100%;
    }
    
    .profile-bio {
        text-align: center;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .profile-actions {
        justify-content: center;
    }
    
    .profile-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 12px 20px;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        gap: 24px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SETTINGS MODAL
   ============================================ */

.settings-modal {
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-content {
    padding: 8px 0;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h4 i {
    font-size: 14px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.settings-item:hover {
    background: var(--bg-tertiary);
}

.settings-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item-value {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-item-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-item > i {
    color: var(--text-muted);
    font-size: 14px;
}

/* Toggle Switch */
.toggle-item {
    cursor: default;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--gradient-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Danger Zone */
.danger-section h4 {
    color: var(--error);
}

.danger-item .settings-item-title {
    color: var(--error);
}

.danger-item > i {
    color: var(--error);
}

.danger-item:hover {
    background: rgba(255, 59, 48, 0.1);
}
