:root {
    --bg-color: #050505;
    --text-color: #a0a0a0;
    --text-glow: #ffffff;
    --border-color: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(10, 10, 10, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #505050;
    --font-main: 'Courier Prime', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Film Grain Overlay */
#grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* Rain / Stars background container */
#rain-container,
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
}

/* Typography */
.verified-badge {
    width: 1.2rem;
    height: 1.2rem;
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
    filter: drop-shadow(0 0 5px rgba(29, 161, 242, 0.5));
}

h1,
h2,
h3 {
    font-weight: normal;
    color: var(--text-glow);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    letter-spacing: -0.5px;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--text-glow);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.2rem;
    color: var(--text-glow);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--accent);
}

.dot {
    width: 6px;
    height: 6px;
    background-color: #4a4a4a;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 5px #4a4a4a;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 5px #4a4a4a;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 10px #7a7a7a;
        background-color: #7a7a7a;
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 5px #4a4a4a;
    }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

/* Main Container */
.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 3rem 1rem;
    width: 100%;
}

.page-header {
    margin-bottom: 3rem;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards;
}

.tagline {
    font-size: 0.9rem;
    color: var(--accent);
    margin-top: 0.5rem;
}

/* Composer Section */
.composer {
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease 0.3s forwards;
}

textarea {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    padding: 1rem;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 2px;
}

textarea:focus {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.03) inset;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

select {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

select:hover {
    color: var(--text-color);
}

select option {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-glow);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Feed & Fragments */
.feed {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.fragment {
    padding: 0.8rem 1rem;
    border-left: 1px solid var(--border-color);
    position: relative;
    opacity: 0;
    animation: fadeIn 2s ease forwards;
    transition: all 0.5s ease;
}

.fragment:hover {
    border-left-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.frag-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.frag-author {
    color: var(--text-glow);
    font-size: 0.75rem;
    /* Letras más pequeñas para el nombre en el post */
    display: flex;
    align-items: center;
}

.frag-header .verified-badge {
    width: 0.9rem;
    /* Check azul más pequeño en los posts */
    height: 0.9rem;
    margin-left: 4px;
}

.frag-time {
    color: var(--accent);
    font-size: 0.65rem;
}

.frag-content {
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.loading-skeleton {
    color: var(--accent);
    animation: pulse-skeleton 2s infinite ease-in-out;
}

@keyframes pulse-skeleton {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.4;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    color: var(--text-glow);
    font-size: 0.9rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.blur-text {
    transition: filter 0.5s ease;
    opacity: 0.8;
}

.blur-text:hover {
    opacity: 1;
}

.avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid var(--glass-border);
    opacity: 0.8;
}

.avatar-small:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4);
}

.avatar-upload-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px dashed var(--border-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    color: var(--text-glow);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.frag-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.reactions-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.8rem;
}

.reaction-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.reaction-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.reaction-count {
    font-size: 0.8rem;
    color: var(--accent);
    font-family: var(--font-main);
}

.echoes-container {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.echo {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.echo-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.echo-content {
    font-size: 0.85rem;
    color: var(--text-color);
}

.echo-composer {
    display: flex;
    margin-top: 1rem;
    align-items: center;
    gap: 0.5rem;
}

.echo-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    padding: 0.5rem;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
}

.echo-input:focus {
    border-bottom-color: var(--text-glow);
    color: var(--text-glow);
}

.echo-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

/* iTunes Profile Player */
.song-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.song-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.song-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-result-info {
    display: flex;
    flex-direction: column;
}

.song-result-title {
    color: var(--text-glow);
    font-size: 0.85rem;
}

.song-result-artist {
    color: var(--accent);
    font-size: 0.75rem;
}

.profile-player {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
    transition: background 0.3s ease;
}

.profile-player:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cover-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.cover-container img {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.profile-player:hover .cover-container img {
    opacity: 0.5;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    color: var(--text-glow);
    animation: blink 2s infinite steps(2, start);
    pointer-events: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.profile-player-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    flex: 1;
}

/* Global Search & Discovery */
.global-search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0;
}

.search-icon {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.search-icon:hover {
    color: var(--text-glow);
}

#global-search-input {
    width: 0;
    opacity: 0;
    padding: 0;
    border: none;
    border-bottom: 1px solid var(--text-glow);
    background: transparent;
    color: var(--text-glow);
    font-family: var(--font-main);
    transition: all 0.3s ease;
    margin-right: 0;
}

.global-search-container.active #global-search-input {
    width: 150px;
    opacity: 1;
    padding: 0.2rem 0.5rem;
    margin-right: 0.5rem;
}

#global-search-input:focus {
    outline: none;
}

#global-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 4px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Discovery Section */
.discovery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 70px;
}

.discovery-item:hover {
    transform: scale(1.05);
}

.discovery-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.discovery-item span {
    font-size: 0.7rem;
    color: var(--text-glow);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.5rem;
        max-width: 100%;
        width: 100%;
    }

    .fragment {
        padding: 0.8rem;
        margin: 0 1rem;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .global-search-container {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin-right: 0;
    }
}


/* Notifications Container */
#notif-dropdown {
    background: rgba(10, 10, 10, 0.4) !important;
    backdrop-filter: blur(25px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#main-feed-title {
    font-size: 1rem; /* Ajusta este número (ej. 1.2rem o 2.0rem) */
}
