/* =========================================================
   Silly Sky - Global Styles (Modern Dark Theme)
   ========================================================= */

:root {
    --bg-dark: #000000;
    --bg-surface: #121212;
    --bg-input: #1e1e1e;
    --primary: #1d9bf0; /* Twitter Blue Style */
    --primary-hover: #1a8cd8;
    --text-main: #e7e9ea;
    --text-gray: #71767b;
    --border: #2f3336;
    --danger: #f4212e;
    --white: #ffffff;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* Универсальные помощники */
.hidden { display: none !important; }
.flex-center { display: flex; justify-content: center; align-items: center; min-height: 100vh; flex-direction: column; }
.text-center { text-align: center; }
.p-3 { padding: 1rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }

/* =========================================================
   Layout & Navigation
   ========================================================= */

#app-container {
    max-width: 600px; /* Ограничение как в мобильных приложениях */
    margin: 0 auto;
    min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: relative;
    padding-bottom: 70px; /* Место под нижнее меню */
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    height: 53px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
}

.nav-logo { height: 28px; width: auto; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    padding: 10px;
    opacity: 0.6;
    transition: 0.2s;
}

.nav-item.active { opacity: 1; }
.nav-item .icon { width: 26px; height: 26px; filter: invert(1); }

/* =========================================================
   Buttons & Forms
   ========================================================= */

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}

.btn-primary:hover { background-color: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger { background-color: var(--danger); color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; }

.auth-card {
    width: 90%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.auth-logo { width: 80px; margin-bottom: 20px; }

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    outline: none;
}

input:focus { border-color: var(--primary); }

/* =========================================================
   Feed & Posts
   ========================================================= */

.post {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.avatar-md { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.avatar-micro { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.avatar-xl { width: 100px; height: 100px; border-radius: 50%; margin: 20px 0; border: 3px solid var(--primary); }

.post-content { flex: 1; }
.post-header { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.post-displayname { font-weight: bold; }
.post-username { color: var(--text-gray); font-size: 0.9rem; }
.post-text { margin-bottom: 12px; white-space: pre-wrap; }
.post-image { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 8px; }

.badge { width: 16px; height: 16px; vertical-align: middle; }

/* =========================================================
   Modals & FAB
   ========================================================= */

.fab {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 10;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(91, 112, 131, 0.4);
    display: flex;
    justify-content: center;
    padding-top: 50px;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-dark);
    width: 100%;
    max-width: 600px;
    height: fit-content;
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Bar */
.search-bar {
    margin-bottom: 0;
    border-radius: 999px;
    background: #202327;
    border: none;
    padding: 8px 20px;
}