/* Webikos - Pixel-Perfect Twitter/X Design System */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============ DESIGN TOKENS - EXACT TWITTER/X MATCH ============ */
:root {
    /* Primary Brand Colors - Exact X/Twitter Blue */
    --x-blue: #1d9bf0;
    --x-blue-hover: #1a8cd8;
    --x-blue-pressed: #1570a6;
    --x-blue-light: rgba(29, 155, 240, 0.1);
    --x-blue-ultra-light: rgba(29, 155, 240, 0.03);

    /* Accent Colors */
    --x-red: #f91880;
    --x-red-hover: #e2165d;
    --x-red-light: rgba(249, 24, 128, 0.1);

    --x-green: #00ba7c;
    --x-green-hover: #00a96e;
    --x-green-light: rgba(0, 186, 124, 0.1);

    --x-yellow: #ffad1f;
    --x-yellow-hover: #e6981c;
    --x-yellow-light: rgba(255, 173, 31, 0.1);

    /* Light Theme - Exact Twitter Match */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-hover: rgba(15, 20, 25, 0.02);
    --bg-hover-strong: rgba(15, 20, 25, 0.05);
    --bg-pressed: rgba(15, 20, 25, 0.1);
    --bg-modal: rgba(91, 112, 131, 0.4);
    --bg-glass: rgba(255, 255, 255, 0.8);

    /* Text Colors */
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --text-tertiary: #657786;
    --text-quaternary: #8b98a5;
    --text-link: #1d9bf0;
    --text-inverse: #ffffff;
    --text-success: #00ba7c;
    --text-error: #f91880;

    /* Borders */
    --border-primary: #eff3f4;
    --border-secondary: #e1e8ed;
    --border-hover: #d0d7de;
    --border-focus: #1d9bf0;

    /* Layout Dimensions - Exact Twitter Measurements */
    --sidebar-width: 275px;
    --main-width: 600px;
    --right-width: 350px;
    --header-height: 53px;
    --nav-item-height: 50px;
    --tweet-padding: 16px;

    /* Border Radius System */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Perfect Shadows */
    --shadow-sm:
        rgba(101, 119, 134, 0.2) 0px 0px 15px,
        rgba(101, 119, 134, 0.15) 0px 0px 3px 1px;
    --shadow-md:
        rgba(101, 119, 134, 0.2) 0px 0px 15px,
        rgba(101, 119, 134, 0.15) 0px 0px 3px 1px;
    --shadow-lg:
        rgba(101, 119, 134, 0.2) 0px 0px 15px,
        rgba(101, 119, 134, 0.15) 0px 0px 3px 1px;
    --shadow-tweet:
        rgba(101, 119, 134, 0.2) 0px 0px 8px,
        rgba(101, 119, 134, 0.08) 0px 0px 1px 1px;

    /* Micro-Animation System */
    --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: 0.15s var(--ease-out-cubic);
    --transition-medium: 0.2s var(--ease-out-cubic);
    --transition-slow: 0.3s var(--ease-out-cubic);
    --transition-bounce: 0.4s var(--ease-bounce);

    /* Typography Scale - Twitter Font System */
    --font-family-primary:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
    --font-family-mono:
        ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono",
        Menlo, monospace;

    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-lg: 17px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 31px;

    --line-height-tight: 1.2;
    --line-height-normal: 1.3;
    --line-height-relaxed: 1.5;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
}

/* Dark Theme - Exact Twitter Dark */
:root[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #16181c;
    --bg-tertiary: #1c1f23;
    --bg-hover: rgba(231, 233, 234, 0.03);
    --bg-hover-strong: rgba(231, 233, 234, 0.08);
    --bg-pressed: rgba(231, 233, 234, 0.12);
    --bg-modal: rgba(91, 112, 131, 0.4);
    --bg-glass: rgba(0, 0, 0, 0.8);

    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --text-tertiary: #8b98a5;
    --text-quaternary: #5b7083;
    --text-link: #1d9bf0;
    --text-inverse: #0f1419;

    --border-primary: #2f3336;
    --border-secondary: #3e4144;
    --border-hover: #4a5056;
}

/* ============ BASE STYLES ============ */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ SCROLLBAR STYLING ============ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-quaternary);
}

/* ============ UTILITY CLASSES ============ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

/* ============ AUTHENTICATION PAGES ============ */
.auth-page {
    background: linear-gradient(
        135deg,
        var(--x-blue) 0%,
        var(--x-blue-pressed) 100%
    );
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.auth-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--x-blue),
        var(--x-red),
        var(--x-green),
        var(--x-yellow)
    );
}

.container {
    padding: 32px;
}

.logo h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.logo p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: var(--font-size-sm);
}

.auth-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 24px;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-medium);
    font-size: var(--font-size-sm);
}

.tab-button.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-button:hover:not(.active) {
    color: var(--text-primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--x-blue);
    box-shadow: 0 0 0 3px var(--x-blue-light);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--x-blue);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: var(--transition-medium);
}

.btn:hover {
    background: var(--x-blue-hover);
    transform: translateY(-1px);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    background: var(--x-blue-pressed);
}

.social-login {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary);
}

.social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 12px;
}

.social-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.error {
    color: var(--text-error);
    font-size: var(--font-size-sm);
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--x-red-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--x-red);
}

.success {
    color: var(--text-success);
    font-size: var(--font-size-sm);
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--x-green-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--x-green);
}

/* ============ MAIN APPLICATION LAYOUT ============ */
.dashboard {
    display: none;
    min-height: 100vh;
    background: var(--bg-primary);
}

.dashboard.active {
    display: flex;
}

.app-main {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ============ LEFT SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-content {
    padding: 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 0 12px;
    margin-bottom: 32px;
}

.logo-container {
    width: 32px;
    height: 32px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.logo-container:hover {
    color: var(--x-blue);
    transform: scale(1.1);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--bg-hover-strong);
    transition: var(--transition-medium);
    z-index: -1;
}

.nav-item:hover {
    background: var(--bg-hover-strong);
    transform: translateX(2px);
}

.nav-item:hover::before {
    left: 0;
}

.nav-item.active {
    font-weight: var(--font-weight-bold);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 24px;
    width: 24px;
    display: flex;
    justify-content: center;
    transition: var(--transition-fast);
}

.nav-text {
    font-size: var(--font-size-xl);
}

.sidebar-tweet-btn {
    margin: 24px 0;
    padding: 16px 32px;
    background: var(--x-blue);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.sidebar-tweet-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: var(--transition-medium);
}

.sidebar-tweet-btn:hover {
    background: var(--x-blue-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sidebar-tweet-btn:hover::before {
    left: 100%;
}

.sidebar-tweet-btn:active {
    transform: translateY(0);
}

.sidebar-user {
    margin-top: auto;
    padding: 12px;
    border-radius: var(--radius-xl);
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-hover-strong);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* ============ MAIN CONTENT AREA ============ */
.main-content {
    flex: 1;
    max-width: var(--main-width);
    border-left: 1px solid var(--border-primary);
    border-right: 1px solid var(--border-primary);
    min-height: 100vh;
}

.main-header {
    position: sticky;
    top: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 100;
}

.main-header h1 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ============ TWEET COMPOSER ============ */
.tweet-composer {
    border-bottom: 1px solid var(--border-primary);
    padding: var(--tweet-padding);
    background: var(--bg-primary);
    position: relative;
}

.composer-content {
    display: flex;
    gap: 12px;
}

.composer-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    position: relative;
}

.composer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.composer-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: var(--line-height-normal);
}

.composer-textarea::placeholder {
    color: var(--text-tertiary);
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
}

.composer-tools {
    display: flex;
    gap: 4px;
}

.composer-tool {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    color: var(--x-blue);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.composer-tool:hover {
    background: var(--x-blue-light);
    transform: scale(1.1);
}

.composer-tweet-btn {
    padding: 8px 24px;
    background: var(--x-blue);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: var(--transition-fast);
    opacity: 0.5;
    pointer-events: none;
}

.composer-tweet-btn.active {
    opacity: 1;
    pointer-events: all;
}

.composer-tweet-btn.active:hover {
    background: var(--x-blue-hover);
    transform: translateY(-1px);
}

/* ============ TWEET FEED ============ */
.tweets-feed {
    background: var(--bg-primary);
}

.tweet {
    border-bottom: 1px solid var(--border-primary);
    padding: var(--tweet-padding);
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    background: var(--bg-primary);
}

.tweet:hover {
    background: var(--bg-hover);
}

.tweet-content {
    display: flex;
    gap: 12px;
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    position: relative;
    transition: var(--transition-fast);
}

.tweet-avatar:hover {
    transform: scale(1.05);
}

.tweet-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tweet-body {
    flex: 1;
    min-width: 0;
}

.tweet-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tweet-author {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.tweet-author:hover {
    text-decoration: underline;
}

.tweet-username {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.tweet-time {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.tweet-text {
    color: var(--text-primary);
    line-height: var(--line-height-relaxed);
    margin-bottom: 12px;
    word-wrap: break-word;
}

.tweet-media {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border-primary);
}

.tweet-media img {
    width: 100%;
    height: auto;
    display: block;
}

.tweet-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 12px;
}

.tweet-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--font-size-sm);
}

.tweet-action:hover {
    background: var(--bg-hover-strong);
}

.tweet-action.liked {
    color: var(--x-red);
}

.tweet-action.retweeted {
    color: var(--x-green);
}

.tweet-action.bookmarked {
    color: var(--x-blue);
}

/* ============ RIGHT SIDEBAR ============ */
.right-sidebar {
    width: var(--right-width);
    padding: 0 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.right-sidebar-content {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--x-blue);
    box-shadow: 0 0 0 3px var(--x-blue-light);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 18px;
}

.widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    transition: var(--transition-fast);
}

.widget:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.widget-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
}

.widget-content {
    padding: 0;
}

.widget-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    transition: var(--transition-fast);
    cursor: pointer;
}

.widget-item:last-child {
    border-bottom: none;
}

.widget-item:hover {
    background: var(--bg-hover);
}

/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 1280px) {
    .right-sidebar {
        display: none;
    }

    .app-main {
        max-width: 920px;
    }
}

@media (max-width: 1000px) {
    .sidebar {
        width: 68px;
    }

    .nav-text {
        display: none;
    }

    .sidebar-tweet-btn {
        width: 50px;
        height: 50px;
        padding: 0;
        font-size: 24px;
    }

    .sidebar-tweet-btn span {
        display: none;
    }

    .sidebar-user {
        width: 50px;
        height: 50px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .app-main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
        border-top: 1px solid var(--border-primary);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        z-index: 1000;
        padding: 8px;
    }

    .sidebar-content {
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        align-items: center;
    }

    .sidebar-logo {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 0;
        flex: 1;
        justify-content: space-around;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        min-width: 60px;
        text-align: center;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-text {
        font-size: 10px;
        font-weight: var(--font-weight-medium);
    }

    .sidebar-tweet-btn {
        display: none;
    }

    .sidebar-user {
        display: none;
    }

    .main-content {
        margin-bottom: 70px;
        border: none;
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin: 16px;
        max-width: none;
    }

    .container {
        padding: 24px;
    }

    .tweet-composer {
        padding: 12px;
    }

    .composer-textarea {
        font-size: var(--font-size-lg);
    }

    .tweet {
        padding: 12px;
    }
}

/* ============ ANIMATIONS & MICRO-INTERACTIONS ============ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translateY(0);
    }
    40%,
    43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-3px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Apply animations */
.auth-container {
    animation: fadeIn 0.6s var(--ease-out-cubic);
}

.dashboard.active {
    animation: fadeIn 0.4s var(--ease-out-cubic);
}

.sidebar {
    animation: slideInLeft 0.5s var(--ease-out-cubic);
}

.main-content {
    animation: fadeIn 0.6s var(--ease-out-cubic) 0.1s both;
}

.right-sidebar {
    animation: slideInRight 0.5s var(--ease-out-cubic) 0.2s both;
}

.tweet {
    animation: fadeIn 0.4s var(--ease-out-cubic);
}

/* ============ LOADING STATES ============ */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-top: 2px solid var(--x-blue);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* ============ MODAL SYSTEM ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-medium);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.modal-close:hover {
    background: var(--bg-hover-strong);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* ============ FORM ENHANCEMENTS ============ */
.form-floating {
    position: relative;
}

.form-floating input {
    padding-top: 20px;
    padding-bottom: 4px;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 16px;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    transform: translateY(16px);
    transition: var(--transition-fast);
    pointer-events: none;
}

.form-floating input:focus + label,
.form-floating input:not(:placeholder-shown) + label {
    transform: translateY(6px);
    font-size: var(--font-size-xs);
    color: var(--x-blue);
}

/* ============ SPECIAL EFFECTS ============ */
.gradient-text {
    background: linear-gradient(135deg, var(--x-blue), var(--x-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-effect {
    box-shadow: 0 0 20px var(--x-blue-light);
}

.scale-on-hover {
    transition: var(--transition-fast);
}

.scale-on-hover:hover {
    transform: scale(1.02);
}

/* ============ FOCUS MANAGEMENT ============ */
.focus-visible:focus-visible {
    outline: 2px solid var(--x-blue);
    outline-offset: 2px;
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--x-blue);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-fast);
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--x-blue-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.95);
}

/* ============ TYPOGRAPHY UTILITIES ============ */
.text-xs {
    font-size: var(--font-size-xs);
}
.text-sm {
    font-size: var(--font-size-sm);
}
.text-base {
    font-size: var(--font-size-base);
}
.text-lg {
    font-size: var(--font-size-lg);
}
.text-xl {
    font-size: var(--font-size-xl);
}
.text-2xl {
    font-size: var(--font-size-2xl);
}
.text-3xl {
    font-size: var(--font-size-3xl);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}
.font-medium {
    font-weight: var(--font-weight-medium);
}
.font-semibold {
    font-weight: var(--font-weight-semibold);
}
.font-bold {
    font-weight: var(--font-weight-bold);
}
.font-extrabold {
    font-weight: var(--font-weight-extrabold);
}

.text-primary {
    color: var(--text-primary);
}
.text-secondary {
    color: var(--text-secondary);
}
.text-tertiary {
    color: var(--text-tertiary);
}
.text-link {
    color: var(--text-link);
}

/* ============ SPACING UTILITIES ============ */
.p-0 {
    padding: 0;
}
.p-1 {
    padding: 4px;
}
.p-2 {
    padding: 8px;
}
.p-3 {
    padding: 12px;
}
.p-4 {
    padding: 16px;
}
.p-5 {
    padding: 20px;
}
.p-6 {
    padding: 24px;
}

.m-0 {
    margin: 0;
}
.m-1 {
    margin: 4px;
}
.m-2 {
    margin: 8px;
}
.m-3 {
    margin: 12px;
}
.m-4 {
    margin: 16px;
}
.m-5 {
    margin: 20px;
}
.m-6 {
    margin: 24px;
}

.mb-0 {
    margin-bottom: 0;
}
.mb-1 {
    margin-bottom: 4px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-3 {
    margin-bottom: 12px;
}
.mb-4 {
    margin-bottom: 16px;
}
.mb-5 {
    margin-bottom: 20px;
}
.mb-6 {
    margin-bottom: 24px;
}

/* ============ LAYOUT UTILITIES ============ */
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-center {
    justify-content: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 {
    gap: 4px;
}
.gap-2 {
    gap: 8px;
}
.gap-3 {
    gap: 12px;
}
.gap-4 {
    gap: 16px;
}

/* ============ BORDER UTILITIES ============ */
.border {
    border: 1px solid var(--border-primary);
}
.border-t {
    border-top: 1px solid var(--border-primary);
}
.border-b {
    border-bottom: 1px solid var(--border-primary);
}
.border-l {
    border-left: 1px solid var(--border-primary);
}
.border-r {
    border-right: 1px solid var(--border-primary);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}
.rounded-md {
    border-radius: var(--radius-md);
}
.rounded-lg {
    border-radius: var(--radius-lg);
}
.rounded-xl {
    border-radius: var(--radius-xl);
}
.rounded-2xl {
    border-radius: var(--radius-2xl);
}
.rounded-full {
    border-radius: var(--radius-full);
}

/* ============ ACCESSIBILITY IMPROVEMENTS ============ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-primary: #000000;
        --border-secondary: #000000;
        --text-secondary: #000000;
    }

    :root[data-theme="dark"] {
        --border-primary: #ffffff;
        --border-secondary: #ffffff;
        --text-secondary: #ffffff;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .sidebar,
    .right-sidebar,
    .theme-toggle,
    .tweet-actions,
    .composer-tools {
        display: none !important;
    }

    .main-content {
        border: none !important;
        max-width: none !important;
    }

    .tweet {
        break-inside: avoid;
        border-bottom: 1px solid #000 !important;
    }
}

/* ============ PERFORMANCE OPTIMIZATIONS ============ */
.tweet-avatar img,
.composer-avatar img {
    will-change: transform;
}

.nav-item,
.tweet-action,
.btn {
    will-change: transform, background-color;
}

/* GPU acceleration for smooth animations */
.sidebar,
.main-content,
.right-sidebar {
    transform: translateZ(0);
}

/* ============ CUSTOM SCROLLBARS FOR SPECIFIC AREAS ============ */
.tweets-feed::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar {
    width: 4px;
}

.tweets-feed::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb {
    background: var(--text-quaternary);
    border-radius: var(--radius-full);
}

/* ============ DARK MODE SPECIFIC ENHANCEMENTS ============ */
:root[data-theme="dark"] .glass-effect {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .auth-container::before {
    opacity: 0.8;
}

:root[data-theme="dark"] .tweet:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ============ SELECTION STYLING ============ */
::selection {
    background: var(--x-blue-light);
    color: var(--text-primary);
}

::-moz-selection {
    background: var(--x-blue-light);
    color: var(--text-primary);
}
