/* ========================================
   ATELIER - ARTIST COMMUNITY PLATFORM
   Complete CSS Stylesheet
   ======================================== */

/* ========================================
   BASE STYLES & VARIABLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --midnight: #1a1a2e;
    --deep-purple: #16213e;
    --coral: #e94560;
    --peach: #ff6b9d;
    --cream: #fef5e7;
    --gold: #ffd93d;
    --teal: #6bcec2;
    --lavender: #c490e4;
    --shadow: rgba(233, 69, 96, 0.2);
    --glow: rgba(255, 217, 61, 0.3);
}

body {
    font-family: 'Work Sans', sans-serif;
    background: linear-gradient(135deg, var(--midnight) 0%, var(--deep-purple) 100%);
    color: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(107, 206, 194, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 217, 61, 0.05) 0%, transparent 40%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.05); }
}

.serif {
    font-family: 'Playfair Display', serif;
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--midnight) 0%, var(--deep-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    flex-direction: column;
    gap: 2rem;
}

.loading-screen.hidden {
    display: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--teal);
    font-size: 1.2rem;
    font-weight: 500;
}

/* ========================================
   AUTHENTICATION SCREEN
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-container.active {
    display: flex;
}

.auth-box {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--coral), var(--peach), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-box .subtitle {
    color: var(--teal);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.error-message {
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid var(--coral);
    color: var(--coral);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(254, 245, 231, 0.6);
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--coral);
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-size: 1rem;
}

.auth-switch button:hover {
    color: var(--peach);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cream);
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--coral);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px var(--shadow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(254, 245, 231, 0.4);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, var(--coral), var(--peach));
    color: white;
    box-shadow: 0 10px 30px var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cream);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    color: var(--cream);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    animation: slideInRight 0.4s ease-out;
    max-width: 350px;
}

.toast.success { border-left: 4px solid var(--teal); }
.toast.error { border-left: 4px solid var(--coral); }
.toast.info { border-left: 4px solid var(--gold); }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   MAIN APP CONTAINER
   ======================================== */

.app-container {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.app-container.active {
    display: block;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--coral), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: rgba(254, 245, 231, 0.7);
    font-weight: 500;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cream);
}

.header-btn.active {
    background: linear-gradient(135deg, var(--coral), var(--peach));
    color: white;
}

.header-btn.upload-btn {
    background: linear-gradient(135deg, var(--teal), var(--lavender));
    color: white;
    font-weight: 600;
}

.header-btn.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(107, 206, 194, 0.4);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   FEED STYLES
   ======================================== */

.feed {
    max-width: 630px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUpFade 0.6s ease-out;
    animation-fill-mode: both;
    position: relative;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.clickable-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.clickable-profile:hover .avatar {
    transform: scale(1.1);
    box-shadow: 0 8px 20px var(--shadow);
}

.clickable-profile:hover .post-author-name {
    color: var(--coral);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.post-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.post-author {
    flex: 1;
}

.post-author-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--cream);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.post-time {
    font-size: 0.85rem;
    color: rgba(254, 245, 231, 0.5);
}

.mini-badges {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.mini-badge {
    font-size: 1rem;
    line-height: 1;
}

.post-image-container {
    width: 100%;
    max-height: 800px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--midnight);
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--cream);
    font-weight: 600;
}

.post-description {
    color: rgba(254, 245, 231, 0.8);
    line-height: 1.6;
}

.post-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cream);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.action-btn.active {
    background: rgba(233, 69, 96, 0.2);
    color: var(--coral);
}

.action-btn.ai-active {
    background: rgba(255, 217, 61, 0.2);
    color: var(--gold);
}

.delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(233, 69, 96, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
}

.post-card:hover .delete-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-btn:hover {
    background: var(--coral);
    transform: scale(1.15);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(254, 245, 231, 0.6);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--cream);
}


/* Gold Member Post Container */
.post-card.gold-member-post {
    position: relative;
    border: 2px solid rgba(255, 217, 61, 0.4);
    background: linear-gradient(135deg, 
        rgba(255, 217, 61, 0.05) 0%, 
        rgba(26, 26, 46, 0.6) 30%,
        rgba(26, 26, 46, 0.6) 70%,
        rgba(255, 217, 61, 0.05) 100%
    );
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 217, 61, 0.2);
    animation: goldPulse 3s ease-in-out infinite;
}

/* Pulsing Gold Glow Animation */
@keyframes goldPulse {
    0%, 100% {
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(255, 217, 61, 0.2);
    }
    50% {
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.3),
            0 0 40px rgba(255, 217, 61, 0.4);
    }
}

/* Shimmering Gold Overlay */
.gold-border-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    pointer-events: none;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 217, 61, 0.1) 25%,
        transparent 50%,
        rgba(255, 217, 61, 0.1) 75%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: goldShimmer 4s ease-in-out infinite;
    z-index: 1;
}

/* Gold Shimmer Animation */
@keyframes goldShimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Floating Crown Icon */
.post-card.gold-member-post::before {
    content: '👑';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(255, 217, 61, 0.6));
    animation: crownFloat 2s ease-in-out infinite;
}

/* Crown Float Animation */
@keyframes crownFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Gold Header Background */
.post-card.gold-member-post .post-header {
    background: linear-gradient(
        90deg,
        rgba(255, 217, 61, 0.1) 0%,
        transparent 50%,
        rgba(255, 217, 61, 0.1) 100%
    );
}

/* Gold Username Styling */
.post-card.gold-member-post .post-author-name {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.3);
}

/* ========================================
   CHAT STYLES
   ======================================== */

.chat-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

.chat-box {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h2 {
    font-size: 1.5rem;
    color: var(--cream);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--coral);
    border-radius: 10px;
}

.chat-message {
    display: flex;
    gap: 1rem;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-avatar:hover {
    transform: scale(1.1);
}

.chat-message-content {
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-message.own .chat-message-content {
    align-items: flex-end;
}

.chat-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    color: var(--cream);
    word-wrap: break-word;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-message.own .chat-bubble {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.3), rgba(255, 107, 157, 0.3));
    border-color: rgba(233, 69, 96, 0.3);
}

.chat-timestamp {
    font-size: 0.75rem;
    color: rgba(254, 245, 231, 0.4);
}

.chat-input-container {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cream);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--coral);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input::placeholder {
    color: rgba(254, 245, 231, 0.4);
}

.chat-send-btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--coral), var(--peach));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow);
}

.chat-empty {
    text-align: center;
    color: rgba(254, 245, 231, 0.5);
    padding: 3rem;
    font-size: 1.1rem;
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========================================
   PROFILE SECTION
   ======================================== */

.profile-header {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 700;
    box-shadow: 0 10px 30px var(--shadow);
}

.profile-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--coral);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid var(--midnight);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.profile-avatar-upload:hover {
    background: var(--gold);
    transform: scale(1.1);
}

.profile-avatar-upload input {
    display: none;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: rgba(254, 245, 231, 0.6);
    font-size: 0.95rem;
}

.profile-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--teal);
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(254, 245, 231, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   BADGE SYSTEM
   ======================================== */

.badge-showcase {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.badge-showcase h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--cream);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-count {
    color: var(--teal);
    font-size: 1rem;
    font-weight: 400;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.badge-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.badge-item:hover {
    transform: translateY(-5px);
    border-color: var(--coral);
    background: rgba(255, 255, 255, 0.05);
}

.badge-item.earned {
    border-color: var(--teal);
    background: rgba(107, 206, 194, 0.1);
}

.badge-item.earned.rare {
    border-color: var(--lavender);
    background: rgba(196, 144, 228, 0.1);
    box-shadow: 0 0 20px rgba(196, 144, 228, 0.2);
}

.badge-item.earned.epic {
    border-color: var(--coral);
    background: rgba(233, 69, 96, 0.1);
    box-shadow: 0 0 25px rgba(233, 69, 96, 0.3);
}

.badge-item.earned.legendary {
    border: 2px solid var(--gold);
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1), rgba(233, 69, 96, 0.1));
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 217, 61, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 217, 61, 0.6); }
}

.badge-item.locked {
    opacity: 0.4;
    cursor: default;
}

.badge-item.locked:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.badge-item.locked .badge-icon {
    filter: grayscale(100%);
}

.badge-name {
    font-size: 0.8rem;
    color: var(--cream);
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
    line-height: 1.2;
}

.badge-progress {
    font-size: 0.75rem;
    color: var(--teal);
}

.badge-item.locked .badge-progress {
    color: rgba(254, 245, 231, 0.4);
}

/* Badge Unlock Modal */
.badge-unlock-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(30px);
    padding: 3rem;
    border-radius: 25px;
    border: 2px solid var(--gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(255, 217, 61, 0.3);
    z-index: 10002;
    max-width: 500px;
    width: 90%;
    display: none;
    animation: badgeUnlock 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.badge-unlock-modal.active {
    display: block;
}

@keyframes badgeUnlock {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotateZ(-10deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateZ(0deg);
    }
}

.badge-unlock-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--gold), var(--coral));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.badge-unlock-icon {
    font-size: 5rem;
    margin: 1rem 0;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.badge-unlock-name {
    font-size: 1.5rem;
    color: var(--cream);
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.badge-unlock-description {
    color: var(--teal);
    margin-bottom: 2rem;
}

/* ========================================
   FOLLOWERS/FOLLOWING
   ======================================== */

.followers-section {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.followers-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--cream);
}

.followers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.follower-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.follower-card:hover {
    transform: translateY(-5px);
    border-color: var(--coral);
    background: rgba(255, 255, 255, 0.05);
}

.follower-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 1rem;
    box-shadow: 0 5px 15px var(--shadow);
}

.follower-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--cream);
    margin-bottom: 0.5rem;
}

.follower-stats {
    font-size: 0.85rem;
    color: var(--teal);
}

.follow-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--coral);
    border-radius: 25px;
    background: transparent;
    color: var(--coral);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    white-space: nowrap;
}

.follow-btn:hover {
    background: var(--coral);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow);
}

.follow-btn.following {
    background: var(--coral);
    color: white;
    border-color: var(--coral);
}

.follow-btn.following:hover {
    background: transparent;
    color: var(--coral);
}

/* ========================================
   INVITE SECTION
   ======================================== */

.invite-section {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.invite-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

#inviteCodesList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.invite-code-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
}

.invite-code-display {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.code-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--teal);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
}

.invite-used-by {
    color: rgba(254, 245, 231, 0.6);
    font-size: 0.9rem;
    text-align: center;
}

.invite-used-by strong {
    color: var(--coral);
}

.invite-available {
    color: var(--teal);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.invite-code {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.invite-code input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--teal);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.75rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--cream);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
}

.modal-backdrop.active {
    display: block;
}

/* ========================================
   UPLOAD MODAL
   ======================================== */

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: var(--coral);
    background: rgba(233, 69, 96, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
    border-radius: 15px;
    overflow: hidden;
    background: var(--midnight);
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.watermark-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    border: 2px dashed rgba(255, 217, 61, 0.5);
    padding: 0.5rem;
    transition: border-color 0.3s ease;
}

.watermark-overlay:hover {
    border-color: var(--gold);
}

.watermark-overlay.dragging {
    border-color: var(--coral);
    background: rgba(233, 69, 96, 0.1);
}

.watermark-text {
    display: block;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: var(--gold);
    border-radius: 50%;
    cursor: nwse-resize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.resize-handle:hover {
    background: var(--coral);
    transform: scale(1.2);
}

.watermark-controls {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.watermark-controls h3 {
    margin-bottom: 1rem;
}

.watermark-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.watermark-preset {
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.watermark-preset:hover {
    border-color: var(--coral);
    background: rgba(255, 255, 255, 0.05);
}

.watermark-preset.active {
    border-color: var(--teal);
    background: rgba(107, 206, 194, 0.1);
}

.slider-group {
    margin-bottom: 1rem;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--coral);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--coral);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px var(--shadow);
}

/* ========================================
   COMMENTS MODAL
   ======================================== */

.comments-section {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: var(--teal);
    margin-bottom: 0.25rem;
}

.comment-text {
    color: rgba(254, 245, 231, 0.8);
    line-height: 1.5;
}

.comment-time {
    font-size: 0.8rem;
    color: rgba(254, 245, 231, 0.4);
    margin-top: 0.25rem;
}

.comment-form {
    display: flex;
    gap: 1rem;
}

.comment-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cream);
    font-family: inherit;
}

.comment-input:focus {
    outline: none;
    border-color: var(--coral);
}

/* ========================================
   USER PROFILE MODAL
   ======================================== */

.user-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
    display: none;
    overflow-y: auto;
}

.user-profile-modal.active {
    display: flex;
}

.user-profile-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 25px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-header-modal {
    padding: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-profile-info-modal {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex: 1;
}

.user-profile-avatar-modal {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 10px 30px var(--shadow);
    flex-shrink: 0;
}

.user-profile-details-modal h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--cream);
}

.user-profile-details-modal .follow-btn {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.user-profile-stats-modal {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.user-posts-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.user-post-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--midnight);
}

.user-post-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.user-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-post-thumbnail:hover .user-post-overlay {
    opacity: 1;
}

.user-post-stats {
    display: flex;
    gap: 1rem;
    color: white;
    font-size: 0.9rem;
}

/* ========================================
   CONFIRMATION MODALS
   ======================================== */

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(30px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    z-index: 10001;
    max-width: 400px;
    width: 90%;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.confirm-modal.active {
    display: block;
}

.confirm-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--coral);
}

.confirm-modal p {
    color: rgba(254, 245, 231, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    gap: 1rem;
}

.confirm-modal-actions button {
    flex: 1;
}

/* ========================================
   ONBOARDING
   ======================================== */

.profile-upload-area {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.profile-preview {
    text-align: center;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--lavender));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 15px 40px var(--shadow);
}

.upload-profile-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--coral);
    border-radius: 25px;
    background: transparent;
    color: var(--coral);
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
}

.upload-profile-btn:hover {
    background: var(--coral);
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .watermark-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-profile-info-modal {
        flex-direction: column;
        text-align: center;
    }

    .user-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .chat-message-content {
        max-width: 75%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .auth-box {
        padding: 2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .watermark-presets {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--coral), var(--peach));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--peach), var(--gold));
}

