/* style.css - Pranga Nostr Web İstemcisi */

:root {
    --pranga-primary: #7e22ce;
    --pranga-primary-dark: #581c87;
    --pranga-bg: #0f172a;
    --pranga-surface: #1e293b;
    --pranga-border: #1f2937;
    --pranga-text: #f8fafc;
    --pranga-text-muted: #94a3b8;
}

body {
    background-color: var(--pranga-bg);
    color: var(--pranga-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--pranga-bg);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Custom classes */
.nav-link {
    transition: all 0.2s ease;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    width: fit-content;
}

.nav-link:hover {
    background-color: rgba(126, 34, 206, 0.1);
}

.nav-link.active {
    font-weight: bold;
    color: #a855f7;
}

/* Feed item styling */
.post-item {
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--pranga-border);
    cursor: pointer;
}

.post-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    object-fit: cover;
    background-color: #334155;
}

/* Media styling */
/* NSFW Content Styling */
.nsfw-blurred {
    filter: blur(20px);
    pointer-events: none;
    user-select: none;
}

.nsfw-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    text-align: center;
    padding: 1rem;
}

.post-media-container {
    position: relative;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(31, 41, 55, 1);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    animation: toastIn 160ms ease-out forwards;
}

.toast-out {
    animation: toastOut 160ms ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}


.post-media {
    max-height: 512px;
    width: 100%;
    object-fit: contain;
    background-color: black;
}

/* Modal styling */
#login-modal {
    z-index: 1000;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-item {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .container {
        padding-bottom: 60px;
    }
}

/* Purple shadow effects */
.shadow-pranga {
    box-shadow: 0 10px 15px -3px rgba(126, 34, 206, 0.3), 0 4px 6px -2px rgba(126, 34, 206, 0.1);
}

.bg-pranga {
    background-color: var(--pranga-primary);
}

.text-pranga {
    color: var(--pranga-primary);
}

.border-pranga {
    border-color: var(--pranga-primary);
}

#section-chat:not(.hidden) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px);
}

@supports (height: 100dvh) {
    #section-chat:not(.hidden) {
        height: calc(100dvh - 72px);
    }
}

#chat-layout {
    flex: 1;
    min-height: 0;
}

#chat-thread {
    flex: 1;
    min-height: 0;
}

#chat-conversations {
    max-height: 240px;
    overflow-y: auto;
}

#chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#chat-compose {
    flex: 0 0 auto;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    position: sticky;
    bottom: 0;
}

#sidebar {
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

#sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body[data-theme="light"] {
    --pranga-bg: #f8fafc;
    --pranga-surface: #ffffff;
    --pranga-border: #dbe4ee;
    --pranga-text: #0f172a;
    --pranga-text-muted: #64748b;
    background-color: var(--pranga-bg) !important;
    color: var(--pranga-text) !important;
}

html:has(body[data-theme="light"]) {
    background-color: #f8fafc !important;
}

body[data-theme="light"].bg-pranga-bg {
    background-color: var(--pranga-bg) !important;
}

body[data-theme="light"] .bg-pranga-bg,
body[data-theme="light"] #sidebar,
body[data-theme="light"] main,
body[data-theme="light"] aside {
    background-color: var(--pranga-bg) !important;
    color: var(--pranga-text) !important;
}

body[data-theme="light"] #section-home,
body[data-theme="light"] #section-explore,
body[data-theme="light"] #section-notifications,
body[data-theme="light"] #section-follow,
body[data-theme="light"] #section-chat,
body[data-theme="light"] #section-profile,
body[data-theme="light"] #section-settings,
body[data-theme="light"] #post-box,
body[data-theme="light"] .post-item,
body[data-theme="light"] aside > div,
body[data-theme="light"] .bg-gray-900\/50,
body[data-theme="light"] .bg-gray-900\/40,
body[data-theme="light"] .bg-gray-950 {
    background-color: #ffffff !important;
    color: var(--pranga-text) !important;
}

body[data-theme="light"] .sticky.bg-pranga-bg\/80,
body[data-theme="light"] .bg-pranga-bg\/80 {
    background-color: rgba(248, 250, 252, 0.92) !important;
}

body[data-theme="light"] .bg-pranga-bg\/70 {
    background-color: rgba(248, 250, 252, 0.78) !important;
}

body[data-theme="light"] .bg-gray-900,
body[data-theme="light"] .toast,
body[data-theme="light"] #user-menu,
body[data-theme="light"] #chat-compose,
body[data-theme="light"] #post-modal > div,
body[data-theme="light"] #login-modal > div,
body[data-theme="light"] #profile-qr-modal > div {
    background-color: #ffffff !important;
}

body[data-theme="light"] .bg-gray-800,
body[data-theme="light"] .post-item:hover,
body[data-theme="light"] .nav-link:hover,
body[data-theme="light"] .post-action:hover {
    background-color: #f1f5f9 !important;
}

body[data-theme="light"] .bg-white\/5 {
    background-color: rgba(15, 23, 42, 0.04) !important;
}

body[data-theme="light"] .border-gray-800,
body[data-theme="light"] .border-gray-700,
body[data-theme="light"] .post-item,
body[data-theme="light"] .toast,
body[data-theme="light"] #sidebar,
body[data-theme="light"] main {
    border-color: var(--pranga-border) !important;
}

body[data-theme="light"] .text-white,
body[data-theme="light"] .text-gray-100,
body[data-theme="light"] .text-gray-200,
body[data-theme="light"] .text-gray-300,
body[data-theme="light"] .text-black {
    color: var(--pranga-text) !important;
}

body[data-theme="light"] .text-gray-400,
body[data-theme="light"] .text-gray-500,
body[data-theme="light"] .text-gray-600,
body[data-theme="light"] .placeholder-gray-500::placeholder {
    color: var(--pranga-text-muted) !important;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] p,
body[data-theme="light"] span,
body[data-theme="light"] label,
body[data-theme="light"] a:not(.text-pranga):not(.text-pranga-light) {
    color: inherit;
}

body[data-theme="light"] .text-pranga-light {
    color: var(--pranga-primary) !important;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
    background-color: #ffffff !important;
    color: var(--pranga-text) !important;
    border-color: var(--pranga-border) !important;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
    color: var(--pranga-text-muted) !important;
}

body[data-theme="light"] .bg-pranga,
body[data-theme="light"] .bg-pranga:hover,
body[data-theme="light"] .hover\:bg-pranga-dark:hover,
body[data-theme="light"] #sidebar-post-btn,
body[data-theme="light"] #sidebar-post-btn-mobile,
body[data-theme="light"] #publish-btn,
body[data-theme="light"] #post-modal-publish,
body[data-theme="light"] #chat-send {
    color: #ffffff !important;
}

body[data-theme="light"] #theme-toggle {
    background-color: #ffffff !important;
}

body[data-theme="light"] #sidebar .nav-link {
    color: var(--pranga-text) !important;
}

body[data-theme="light"] #sidebar .nav-link.active {
    color: var(--pranga-primary) !important;
    background-color: rgba(126, 34, 206, 0.08) !important;
}

body[data-theme="light"] .hover\:bg-white\/5:hover,
body[data-theme="light"] .hover\:bg-gray-800:hover {
    background-color: #eef2ff !important;
}

body[data-theme="light"] .hover\:text-white:hover {
    color: var(--pranga-text) !important;
}

body[data-theme="light"] .shadow-pranga,
body[data-theme="light"] .shadow-pranga\/20,
body[data-theme="light"] .shadow-lg {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

@media (max-width: 1024px) {
    body {
        justify-content: flex-start;
    }

    .container {
        max-width: 100%;
    }

    #sidebar {
        width: 72px;
        min-width: 72px;
        padding: 0.875rem 0.5rem;
    }

    #sidebar nav {
        gap: 1rem;
        align-items: center;
    }

    #sidebar nav > a,
    #sidebar nav > button {
        width: 100%;
        justify-content: center;
        align-self: center;
    }

    #sidebar .nav-link {
        justify-content: center;
        padding: 0.35rem 0;
    }

    #sidebar nav > a:first-child {
        margin-bottom: 0.5rem;
    }

    #sidebar #sidebar-post-btn {
        display: none !important;
    }

    #sidebar #sidebar-post-btn-mobile {
        display: inline-flex !important;
        align-self: center;
    }

    #sidebar #user-info {
        justify-content: center;
        padding: 0;
    }

    #sidebar #login-modal-btn {
        width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    main {
        max-width: none !important;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
    }

    main {
        border-right-width: 0 !important;
    }

    main > div.sticky {
        padding: 0.75rem;
    }

    #section-home,
    #section-explore,
    #section-notifications,
    #section-follow,
    #section-chat,
    #section-profile,
    #section-settings {
        min-width: 0;
    }

    #post-box {
        padding: 0.875rem;
    }

    .post-item {
        padding: 0.875rem;
    }

    #chat-start-btn,
    #chat-send,
    #theme-toggle {
        flex-shrink: 0;
    }

    #chat-start-peer,
    #chat-input {
        min-width: 0;
    }

    #profile-view-banner {
        height: 140px !important;
    }

    #profile-view-avatar {
        width: 96px !important;
        height: 96px !important;
    }

    #profile-view-header .-mt-16 {
        margin-top: -2.75rem !important;
    }

    #profile-view-header .flex.justify-between.items-end {
        align-items: flex-start !important;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    #profile-view-header .px-4.pb-4 {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }

    #profile-following-btn,
    #profile-followers-btn {
        min-width: 0;
    }

    #profile-connections .p-4,
    #section-chat .p-4 {
        padding: 0.875rem !important;
    }

    #post-modal > div,
    #login-modal > div,
    #profile-qr-modal > div {
        max-width: calc(100vw - 1rem) !important;
    }
}
