:root {
    --primary-color: #ff0050;
    --secondary-color: #00f2fe;
    --background-color: #000;
    --surface-color: #121212;
    --text-color: #fff;
    --border-color: #2f2f2f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden; 
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

/* Splash Screen */
#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.splash-logo {
    font-size: 10rem;
    font-weight: bold;
    color: var(--primary-color);
    animation: pulse-logo 2s infinite ease-in-out;
}

@keyframes pulse-logo {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Navigation Bar */
.navbar {
    flex-shrink: 0; /* Prevent navbar from shrinking */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--background-color);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: display 0.3s;
}

.nav-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.03em;
}

.nav-icons {
    display: flex;
    gap: 20px;
}

.nav-icon {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
    position: relative;
}

.nav-icon.active, .nav-icon:hover {
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main Content */
.main-content {
    flex-grow: 1; /* Allow main content to take up available space */
    position: relative;
    overflow: hidden; /* Hide overflow from screen transitions */
}

.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

.screen.active {
    display: block;
}

/* Add padding to screens that need it, except full-width ones like Reels */
#feedScreen, #musicScreen, #profileScreen, #offlineMusicScreen, #bucketScreen {
     padding: 140px 20px 20px;
     max-width: 600px;
     margin: 0 auto;
}

.screen-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Feed Screen */
.feed-item {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.feed-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.profile-header .profile-pic {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.profile-header .profile-pic:hover {
    transform: scale(1.05);
}

.username {
    font-weight: bold;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

.post-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.action-icon {
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.action-icon:hover {
    color: var(--primary-color);
}

.action-icon.liked {
    color: var(--primary-color);
}

.comments-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #aaa;
}

.comment-item {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.comment-author {
    font-weight: bold;
    color: var(--secondary-color);
}

.comment-text {
    margin-left: 5px;
    flex-grow: 1;
    word-break: break-word; /* Ensure long comments wrap */
}

.comment-delete-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: color 0.2s;
}
.comment-delete-btn:hover {
    color: var(--primary-color);
}


.comment-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.comment-input-container input {
    flex-grow: 1;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: #222;
    color: var(--text-color);
}

.comment-input-container button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
}

.comment-input-container .audio-btn,
.comment-item .audio-play-btn {
    color: var(--secondary-color);
}

.comment-input-container .audio-btn.recording {
    color: var(--primary-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Profile Screen */
.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-header h2 {
    margin-top: 10px;
}

.profile-header p {
    color: #aaa;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 15px;
}

.stat-item {
    text-align: center;
}

.stat-item span {
    font-weight: bold;
    font-size: 1.2em;
}

.profile-bio {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding: 0 25px; /* Space for the button */
}

.edit-bio-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9em;
    position: absolute;
    top: 0;
    right: 0;
    transition: color 0.2s;
}

.edit-bio-btn:hover {
    color: var(--secondary-color);
}

#editBioContainer {
    display: none; /* controlled by JS */
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

#editBioContainer textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #222;
    color: var(--text-color);
    resize: vertical;
}

.profile-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 5px;
}

.profile-post-item {
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    position: relative;
    cursor: pointer;
}

.profile-post-item img, .profile-post-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

/* Overlay for view counts on profile grid */
.post-overlay-info {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none; /* So it doesn't interfere with clicks */
    flex-direction: column;
    align-items: flex-start;
}

.post-overlay-info .uploader-info {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}
.post-overlay-info .uploader-info img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: static; /* override absolute positioning */
}
.post-overlay-info .uploader-info span {
    font-size: 0.9em;
    font-weight: bold;
}
.post-overlay-info .stats-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
}

.delete-post-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 80, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-post-item:hover .delete-post-btn {
    opacity: 1;
}


.profile-wallet {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-balance {
    font-size: 1.5em;
    font-weight: bold;
}

.withdraw-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.withdraw-btn:hover {
    background-color: #ff3377;
}

/* Music Screen */
.music-search-bar {
    position: relative;
    background-color: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 24px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.music-search-bar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.music-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.music-search-bar input:focus {
    border-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.search-suggestions {
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    margin-top: 5px;
    display: none;
}

.suggestion-item {
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.suggestion-item:hover {
    background-color: #333;
}

.music-section-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #aaa;
}

.music-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.music-list-container.empty-container {
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.music-list-container.empty-container .empty-state {
    text-align: center;
    max-width: 420px;
    color: #bbb;
    font-size: 1em;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    color: #bbb;
    line-height: 1.6;
}

.profile-posts-grid.is-empty {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 320px;
    text-align: center;
}

.profile-posts-grid.is-empty .empty-state {
    font-size: 1.1em;
    max-width: 460px;
}

.music-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--surface-color);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.music-item:hover {
    background-color: #1a1a1a;
}

.music-item-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.music-details {
    flex-grow: 1;
    min-width: 0; /* Important for flex text wrapping */
}

.music-details h3, .music-details p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-details h3 {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.music-details p {
    font-size: 0.8em;
    color: #aaa;
}

.music-details .artist-name {
    cursor: pointer;
    transition: color 0.3s;
}
.music-details .artist-name:hover {
    color: var(--secondary-color);
}

.music-details .music-plays {
    font-size: 0.7em;
    color: #777;
    margin-top: 5px;
}

.music-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
}

.music-play-btn:hover {
    transform: scale(1.1);
}

.music-top-earned {
    margin-top: 30px;
}

.top-earned-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-earned-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1a1a1a;
    padding: 8px;
    border-radius: 8px;
}

.top-earned-item img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
}

.top-earned-info {
    flex-grow: 1;
}

.top-earned-info h4 {
    font-size: 0.9em;
}

.top-earned-info p {
    font-size: 0.7em;
    color: #999;
}

.earned-amount {
    font-weight: bold;
    color: var(--secondary-color);
}

/* Artist signup form */
.artist-signup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: calc(100vh - 200px); /* Adjust height */
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

#videoUploadContainer,
#artistSignupContainer {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.artist-signup-form::-webkit-scrollbar {
    width: 8px;
}

.artist-signup-form::-webkit-scrollbar-track {
    background: #222;
    border-radius: 10px;
}

.artist-signup-form::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.artist-signup-form label {
    font-weight: bold;
    color: var(--secondary-color);
}

.artist-signup-form input,
.artist-signup-form textarea,
.artist-signup-form button {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #222;
    color: var(--text-color);
}

.artist-signup-form input[type="file"] {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    padding: 10px;
    background-color: #333;
    border: 2px dashed var(--border-color);
    transition: border-color 0.2s ease;
}

.artist-signup-form input[type="file"]:hover {
    border-color: var(--primary-color);
}

.artist-signup-form input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 0, 80, 0.2);
}

.artist-signup-form button:disabled {
    background-color: #555;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.artist-signup-form textarea {
    resize: none;
}

.artist-signup-form button {
    background-color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

.artist-signup-form button:hover {
    background-color: #ff3377;
}

.progress-bar-container {
    width: 100%;
    background-color: #333;
    border-radius: 25px;
    margin: 15px 0;
    height: 20px;
    overflow: hidden;
    display: none; /* Initially hidden */
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 25px;
    transition: width 0.2s ease-in-out;
    text-align: center;
    line-height: 20px;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
}

.generate-btn {
    background-color: var(--secondary-color);
    color: var(--background-color);
}

.generate-btn:hover {
    background-color: #00e2ee;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Home Screen Music Grid */
.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.music-grid-item {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.music-grid-item:hover {
    transform: scale(1.03);
}

.music-grid-cover {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.music-grid-info {
    padding: 10px;
}

.music-grid-title {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-grid-artist {
    font-size: 0.8em;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-grid-plays {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.7em;
}

/* Follow Button */
.follow-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.follow-btn:hover {
    background-color: #ff3377;
}

.follow-btn.following {
    background-color: #555;
    color: #ccc;
}

.follow-btn.following:hover {
    background-color: #777;
}

/* Audio Player Styles */
.audio-player {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-progress {
    flex-grow: 1;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.audio-progress-filled {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    width: 0%;
}

.audio-time {
    font-size: 0.7em;
    color: #aaa;
    min-width: 80px;
    text-align: right;
}

.preview-label {
    background-color: var(--secondary-color);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 5px;
}

.purchase-btn, .renew-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.purchase-btn:hover {
    background-color: #ff3377;
}

.purchase-btn.purchased {
    background-color: #00cc00;
    cursor: not-allowed;
}

.purchase-btn.purchased:hover {
    background-color: #00aa00;
}

.renew-btn {
     background-color: var(--secondary-color);
     color: var(--background-color);
}

/* Modal Styles (General) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1200;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1201;
    pointer-events: auto;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

/* Auth Modal */
.auth-modal-content { /* inherits from modal-content */ }
.auth-form-container {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
.auth-form-container h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
.auth-form input {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #222;
    color: var(--text-color);
    font-size: 1em;
}
.auth-form button {
    padding: 14px;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.auth-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.auth-form button:hover {
    background-color: #ff3377;
}
.auth-toggle-link {
    text-align: center;
    margin-top: 20px;
    color: #aaa;
}
.auth-toggle-link span {
    color: var(--secondary-color);
    cursor: pointer;
    font-weight: bold;
}
.auth-toggle-link span:last-child {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    display: inline-block;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.auth-toggle-link span:last-child:hover {
    color: #ff3377;
}
#signupForm, #forgotPasswordForm { display: none; }

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 45px; /* Make space for the icon */
}

.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
}

.forgot-password-link {
    text-align: right;
    font-size: 0.9em;
    color: var(--secondary-color);
    cursor: pointer;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Payment & Withdrawal Modals */
.payment-modal { /* Inherit from modal-overlay */ }
.payment-modal-content { /* Inherit from modal-content */ }

.payment-modal h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
}

.payment-modal p { margin-bottom: 20px; }
.payment-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.payment-option { display: flex; align-items: center; padding: 10px; background-color: #222; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; text-align: left; }
.payment-option:hover { background-color: #333; }
.payment-option input { margin-right: 10px; }
.payment-option-logo { width: 70px; height: 35px; margin-right: 15px; object-fit: contain; }
.payment-modal button { padding: 10px 20px; border-radius: 20px; border: none; background-color: var(--primary-color); color: #fff; font-weight: bold; cursor: pointer; transition: background-color 0.3s; margin: 5px; }
.payment-modal button:hover { background-color: #ff3377; }
.payment-modal button.cancel-btn { background-color: #555; }
.payment-modal button.cancel-btn:hover { background-color: #777; }

.withdrawal-modal-content h3 {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--primary-color);
}
.withdrawal-form { display: flex; flex-direction: column; gap: 15px; }
.withdrawal-form .form-group { display: flex; flex-direction: column; }
.withdrawal-form label { font-weight: bold; color: var(--secondary-color); margin-bottom: 5px; font-size: 0.9em; }
.withdrawal-form input { 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    background-color: #222; 
    color: var(--text-color); 
    font-size: 1em;
}
.withdrawal-buttons { display: flex; justify-content: space-between; margin-top: 20px; gap: 15px; }
.withdrawal-buttons button { flex: 1; padding: 12px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; font-size: 1em; transition: background-color 0.3s; }
.withdraw-confirm-btn { background-color: var(--primary-color); color: white; }
.withdraw-confirm-btn:hover { background-color: #ff3377; }
.withdraw-cancel-btn { background-color: #555; color: white; }
.withdraw-cancel-btn:hover { background-color: #777; }

/* Artist Profile Modal */
.artist-modal { /* Inherit from modal-overlay */ }
.artist-modal-content {
    background-color: var(--surface-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    height: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.artist-modal-header { padding: 20px; text-align: center; border-bottom: 1px solid var(--border-color); }
.artist-modal-body { padding: 20px; flex-grow: 1; overflow-y: auto; }
.artist-modal-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 15px; }
.artist-modal-tab { padding: 10px 15px; cursor: pointer; border-bottom: 2px solid transparent; }
.artist-modal-tab.active { border-bottom-color: var(--primary-color); color: var(--primary-color); }
.artist-modal-tab-content { display: none; }
.artist-modal-tab-content.active { display: block; }

/* Reels Screen */
.reels-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.reel-item {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.reel-sound-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reel-sound-icon.visible {
    opacity: 1;
}

.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
}

.reel-info { flex-grow: 1; min-width: 0; } /* min-width for flex wrapping */
.reel-info h3 { font-size: 1.2em; margin-bottom: 5px; }
.reel-info p { font-size: 0.9em; color: #ccc; margin-bottom: 10px; }
.reel-creator { display: flex; align-items: center; gap: 8px; }
.reel-creator-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    object-fit: cover; 
    cursor: pointer; 
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.reel-creator-avatar:hover { 
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}
.reel-creator p { margin: 0; }
.reel-actions { display: flex; flex-direction: column; gap: 25px; align-items: center; }
.reel-action-btn { background: none; border: none; color: var(--text-color); font-size: 1.8em; cursor: pointer; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.reel-action-btn i.liked { color: var(--primary-color); }
.reel-action-btn span { display: block; font-size: 0.5em; font-weight: bold; margin-top: 5px; }
.reel-purchase-container { width: 100%; }
.reel-purchase-btn { background-color: var(--primary-color); color: var(--text-color); border: none; padding: 10px 18px; border-radius: 25px; cursor: pointer; margin-top: 10px; font-weight: bold; transition: background-color 0.3s; display: block; }
.reel-purchase-btn:hover { background-color: #ff3377; }
.reel-purchase-btn.purchased { background-color: #00cc00; cursor: not-allowed; }
.reel-purchase-btn.purchased:hover { background-color: #00aa00; }

/* Like Wind Animation */
.like-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    font-size: 8em;
    color: rgba(255, 0, 80, 0.8);
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

.like-animation.animate {
    animation: like-wind 0.7s ease-out;
}

@keyframes like-wind {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.9;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Video Payment Overlay */
.video-payment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: white;
}

.video-payment-overlay h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.video-payment-overlay p {
    margin-bottom: 20px;
    color: #ccc;
}

.pay-to-watch-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s, transform 0.2s;
}

.pay-to-watch-btn:hover {
    background-color: #ff3377;
    transform: scale(1.05);
}

/* Comments Modal */
.comments-modal-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 600;
    display: none;
    justify-content: center;
    align-items: flex-end;
}

.comments-modal {
    background-color: var(--surface-color);
    width: 100%;
    height: 70%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.comments-modal-overlay.active { display: flex; }
.comments-modal-overlay.active .comments-modal { transform: translateY(0); }
.comments-modal-header { padding: 15px; text-align: center; border-bottom: 1px solid var(--border-color); position: relative; }
.comments-modal-close { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-color); font-size: 1.5em; cursor: pointer; }
.comments-list { flex-grow: 1; overflow-y: auto; padding: 15px; }
.comment-input-form { padding: 15px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; position: relative; align-items: center; }
.comment-input { flex-grow: 1; padding: 10px 15px; border-radius: 20px; border: none; background-color: #222; color: var(--text-color); }
.comment-post-btn { background: none; border: none; color: var(--primary-color); font-size: 1.5em; cursor: pointer; }
.artist-tag { color: var(--secondary-color); font-weight: bold; cursor: pointer; }
.tag-suggestions { position: absolute; bottom: 100%; left: 15px; right: 15px; background-color: #333; border: 1px solid var(--border-color); border-radius: 8px; max-height: 150px; overflow-y: auto; display: none; }
.tag-suggestion-item { padding: 10px; cursor: pointer; }
.tag-suggestion-item:hover { background-color: #444; }

/* Footer Navigation */
.footer-nav {
    flex-shrink: 0; /* Prevent footer from shrinking */
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    background-color: var(--background-color);
    transition: display 0.3s;
}

.footer-icon-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1.2em;
    transition: color 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border-radius: 999px;
}

.footer-icon-btn i {
    font-size: 1.4em;
}

.footer-icon-btn .nav-label {
    display: none;
    font-size: 0.95em;
    font-weight: 500;
}

.footer-icon-btn.active, .footer-icon-btn:hover {
    color: var(--primary-color);
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 150;
    display: none;
    flex-direction: column;
    padding: 20px;
    padding-top: 70px; /* Space for status bar on phones */
}

.search-modal.active { display: flex; }
.search-modal-header { display: flex; align-items: center; margin-bottom: 20px; }
.search-modal-input { flex-grow: 1; padding: 12px 20px; border-radius: 25px; border: 1px solid var(--border-color); background-color: var(--surface-color); color: var(--text-color); font-size: 16px; outline: none; }
.search-modal-close { background: none; border: none; color: var(--text-color); font-size: 24px; margin-left: 15px; cursor: pointer; }
#searchResults {
    overflow-y: auto;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-result-item:hover {
    background-color: var(--surface-color);
}


/* Custom Alert Modal */
.alert-modal-overlay { /* inherits from modal-overlay */ }
.alert-modal {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
}
.alert-modal p { margin-bottom: 20px; font-size: 1.1em; }
.alert-modal button { padding: 10px 25px; border-radius: 20px; border: none; background-color: var(--primary-color); color: #fff; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; }
.alert-modal button:hover { background-color: #ff3377; }
.alert-modal .cancel-btn { background-color: #555; margin-right: 10px; }
.alert-modal .cancel-btn:hover { background-color: #777; }

.country-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    background-color: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.country-item:hover {
    border-color: var(--secondary-color);
}

.country-item.selected {
    border-color: var(--secondary-color);
    background-color: rgba(0, 242, 254, 0.08);
}

.country-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
}

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

.preferences-actions span {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.75);
}

/* Notification Panel */
.notification-panel {
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
}

/* Full screen notification view */
body.notification-view-active .navbar,
body.notification-view-active .main-content,
body.notification-view-active .footer-nav {
    display: none;
}

body.notification-view-active .notification-panel {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: var(--background-color);
}

.notification-header { padding: 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.notification-header h3 { color: var(--primary-color); }
.notification-clear { background: none; border: none; color: var(--secondary-color); cursor: pointer; }
.notification-close-btn { background: none; border: none; color: var(--text-color); font-size: 24px; cursor: pointer; margin-left: 15px; }
.notification-list { overflow-y: auto; flex-grow: 1; }
.notification-item { padding: 12px 15px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background-color 0.2s; }
.notification-item:hover { background-color: #1a1a1a; }
.notification-item.unread { background-color: rgba(255, 0, 80, 0.1); }
.notification-content { font-size: 0.9em; margin-bottom: 5px; }
.notification-time { font-size: 0.7em; color: #777; }

/* Profile Settings Menu */
.profile-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    z-index: 20;
}

.settings-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 500;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.settings-screen.active {
    display: flex;
}


.settings-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.settings-header .back-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    margin-right: 20px;
    cursor: pointer;
}

.settings-header h3 {
    font-size: 1.2em;
}

.settings-body {
    padding: 20px;
    flex-grow: 1;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h4 {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 8px;
}

.settings-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.settings-item .item-content {
    display: flex;
    align-items: center;
}

.settings-item i {
    font-size: 18px;
    width: 40px;
    text-align: center;
    color: #ccc;
    margin-right: 15px;
}

.settings-item span {
    font-size: 1em;
}

.settings-item .item-value {
    color: #888;
    font-size: 0.9em;
}

/* Sub-Settings Screens Specific Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #aaa;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #222;
    color: var(--text-color);
    font-size: 1em;
}

.form-group p {
    color: #888;
    font-size: 0.9em;
}

.save-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s;
}
.save-btn:hover {
    background-color: #ff3377;
}

.delete-btn {
    background-color: #d9534f;
    color: white;
}
.delete-btn:hover {
     background-color: #c9302c;
}

#countryList {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    margin-top: 15px;
}

.country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5px;
    border-bottom: 1px solid var(--border-color);
}

.language-item.selected {
    color: var(--primary-color);
    font-weight: bold;
}

/* Toggle Switch CSS */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px 0;
}

.toggle-switch-container label {
     color: #aaa;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.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: #333;
    transition: .4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Profile Picture Zoom Modal */
#profilePicModal {
    align-items: center;
    justify-content: center;
}
#zoomedProfilePic {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#profilePicModal .modal-close-btn {
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    text-shadow: 0 0 5px black;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    body {
        flex-direction: row;
        align-items: stretch;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 240px;
        right: 0;
        padding: 20px 60px;
        background-color: var(--background-color);
        border-bottom: 1px solid var(--border-color);
        max-width: none;
        margin: 0;
        z-index: 90;
    }

    .main-content {
        margin-left: 240px;
        padding-top: 90px;
        width: calc(100% - 240px);
        height: 100vh;
        overflow: hidden;
    }

    .screen {
        padding-bottom: 160px;
    }

    #feedScreen, #musicScreen, #profileScreen, #offlineMusicScreen, #bucketScreen {
        max-width: 760px;
        padding: 60px 0 160px;
        margin: 0 auto;
        min-height: calc(100vh - 320px);
    }

    .footer-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 240px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding: 120px 28px 60px;
        border-right: 1px solid var(--border-color);
        border-top: none;
        background-color: var(--background-color);
    }

    .footer-nav::before {
        content: 'iConnect';
        display: block;
        width: 100%;
        font-size: 1.6em;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 30px;
        letter-spacing: 0.04em;
    }

    .footer-icon-btn {
        flex: none;
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
        padding: 12px 18px;
        font-size: 1em;
        border-radius: 12px;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .footer-icon-btn i {
        font-size: 1.3em;
    }

    .footer-icon-btn .nav-label {
        display: block;
        font-weight: 600;
        letter-spacing: 0.02em;
    }

    .footer-icon-btn.active,
    .footer-icon-btn:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--primary-color);
    }

    .main-content .screen::-webkit-scrollbar {
        display: none;
    }

    #profileContent {
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .profile-header {
        margin-bottom: 20px;
        align-items: center;
    }

    .profile-stats,
    .profile-wallet {
        max-width: 100%;
    }

    .music-section-title {
        text-align: left;
        font-size: 1.3em;
        margin: 30px 0 20px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .profile-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 24px;
    }

    .profile-post-item {
        border-radius: 16px;
        overflow: hidden;
        background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .profile-post-item:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    }

    .music-list-container.empty-container {
        min-height: 360px;
    }

    .profile-posts-grid.is-empty {
        min-height: 420px;
    }
}

@media (min-width: 1400px) {
    .footer-nav {
        width: 280px;
        padding: 140px 32px 80px;
    }

    .navbar {
        left: 280px;
        padding: 24px 80px;
    }

    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
        padding-top: 110px;
    }

    #feedScreen, #musicScreen, #profileScreen, #offlineMusicScreen, #bucketScreen {
        max-width: 880px;
        padding: 60px 0 180px;
        min-height: calc(100vh - 320px);
    }

    .music-list-container.empty-container {
        min-height: 420px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 15px;
    }
    #feedScreen, #musicScreen, #profileScreen, #offlineMusicScreen, #bucketScreen {
        padding: 15px;
    }
     .profile-menu-btn {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
     #feedScreen, #musicScreen, #profileScreen, #offlineMusicScreen, #bucketScreen {
        padding: 10px;
    }
    .profile-menu-btn {
        top: 10px;
        right: 10px;
    }
    .music-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .music-details {
        margin-top: 10px;
        width: 100%;
    }
    .nav-title {
        font-size: 20px;
    }
    .nav-icons {
        gap: 15px;
    }
    .nav-icon {
        font-size: 18px;
    }
    .footer-icon-btn {
        font-size: 1.1em;
    }
    .reel-info h3 { font-size: 1em; }
    .reel-action-btn { font-size: 1.5em; }
}

.share-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f5;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 0.9rem;
}

.share-icon-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
}

.share-icon-btn:active {
    transform: scale(0.98);
}

.share-icon-btn .share-count {
    color: #ff7dad;
    font-weight: 600;
    font-size: 0.85rem;
}

.highlight-share {
    animation: sharePulse 1.4s ease-in-out 2;
    border-radius: 18px;
    box-shadow: 0 0 0 rgba(255, 0, 102, 0.25);
}

@keyframes sharePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 102, 0.0);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 18px rgba(255, 0, 102, 0.18);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 102, 0.0);
        transform: scale(1);
    }
}
