/* filepath: /home/tombrz/GratyTaty/apps/base/static/css/styles.css */

:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --nav-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --secondary-bg: #e9ecef;
    --muted-text: #6c757d;
    --link-color: #0d6efd;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e9ecef;
    --nav-bg: #2d2d2d;
    --card-bg: #2d2d2d;
    --border-color: #444;
    --input-bg: #3a3a3a;
    --input-border: #555;
    --secondary-bg: #3a3a3a;
    --muted-text: #adb5bd;
    --link-color: #6ea8fe;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container-fluid {
    display: flex;
    flex-direction: column;
    flex: 1;
}

main {
    flex: 1;
}

footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
}

/* Desktop - sticky footer */
@media (min-width: 992px) {
    footer {
        position: sticky;
        bottom: 0;
    }
}

/* Mobile - fixed footer */
@media (max-width: 991px) {
    body {
        padding-bottom: 80px;
    }

    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100;
    }
}

.category-menu {
    max-height: 80vh;
    overflow-y: auto;
}

.entry-card {
    height: 100%;
    position: relative;
}

.entry-card img {
    object-fit: cover;
    height: 200px;
}

.favorite-btn {
    position: absolute;
    border: none;
    outline: none;
    /* Usuwa obramowanie focusa */
    transform: none !important;
    transition: none !important;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.menu li {
    margin-right: 20px;
}

.user-menu {
    position: relative;
}

.user-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.user-menu .dropdown-menu li {
    padding: 10px;
}

.user-menu .dropdown-menu li a {
    text-decoration: none;
    color: black;
}

.user-menu .dropdown-menu li a:hover {
    background-color: #f1f1f1;
}

.offer-list {}

.offer {
    border: solid 1px black;
}

/* Messaging */
.chat-box {
    max-height: 60vh;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    gap: 0.25rem;
}

.chat-message-self {
    align-items: flex-end;
}

.chat-message-other {
    align-items: flex-start;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    color: #212529;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-message-self .chat-bubble {
    background: #0d6efd;
    color: #fff;
    border-color: #0b5ed7;
    border-bottom-right-radius: 4px;
}

.chat-message-other .chat-bubble {
    border-bottom-left-radius: 4px;
}

/* Buyer messages - cyan/info color */
.chat-message-buyer.chat-message-self .chat-bubble {
    background: #0dcaf0;
    color: #000;
    border-color: #0aa2c0;
}

/* Seller messages - green/success color */
.chat-message-seller.chat-message-self .chat-bubble {
    background: #198754;
    color: #fff;
    border-color: #146c43;
}

/* Other user buyer messages */
.chat-message-buyer.chat-message-other .chat-bubble {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Other user seller messages */
.chat-message-seller.chat-message-other .chat-bubble {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

/* Message input form styling */
.message-input-form {
    display: flex;
    flex-direction: column;
}

.message-input-form textarea {
    border-radius: 14px;
    border: 1px solid #dee2e6;
    padding: 10px 14px;
    min-height: 80px;
    resize: vertical;
    max-height: 150px;
    font-size: 0.95rem;
}

.message-input-form textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.message-submit-btn {
    white-space: nowrap;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.message-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.message-submit-btn:active {
    transform: translateY(0);
}

/* Thread list styling */
.thread-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.thread-list .list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.thread-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.thread-list .list-group-item:hover:not(.active) {
    background-color: #f8f9fa;
}

/* Dark mode specific styles */
[data-theme="dark"] nav,
[data-theme="dark"] footer {
    background-color: var(--nav-bg) !important;
    color: var(--text-color);
}

[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--link-color);
}

[data-theme="dark"] .text-muted {
    color: var(--muted-text) !important;
}

[data-theme="dark"] a {
    color: var(--link-color);
}

[data-theme="dark"] .list-group-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .list-group-item:hover:not(.active) {
    background-color: var(--secondary-bg);
}

[data-theme="dark"] .chat-box {
    background-color: var(--secondary-bg);
}

[data-theme="dark"] .chat-bubble {
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-message-other .chat-bubble {
    background-color: var(--secondary-bg);
    color: var(--text-color);
}

[data-theme="dark"] .entry-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

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

[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-color) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--secondary-bg);
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-item.active {
    background-color: var(--link-color);
    color: #ffffff;
}

[data-theme="dark"] .dropdown-menu li a {
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-menu li a:hover {
    background-color: var(--secondary-bg);
}

/* Theme toggle button */
#theme-toggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

/* Selector dropdowns */
.selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    margin-top: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 5px;
    background-color: var(--card-bg);
    min-width: 120px;
}

.selector-dropdown select {
    border: none;
    background-color: transparent;
    overflow-y: visible !important;
    max-height: none !important;
}

.cursor-pointer {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cursor-pointer:hover {
    transform: scale(1.1);
}

/* Bundle item thumbnails */
.bundle-item-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.bundle-item-thumb-placeholder {
    width: 60px;
    height: 60px;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-size: 24px;
}

/* Messages Notification */
.messages-notification {
    position: relative;
}

.messages-notification .badge {
    font-size: 0.7rem;
    padding: 0.2em 0.4em;
    min-width: 1.2em;
    height: 1.2em;
    line-height: 1;
}

/* New messages separator */
.new-messages-separator {
    margin: 1rem -1rem;
    position: relative;
    width: calc(100% + 2rem);
}

.new-messages-separator hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
    width: 100%;
}

.new-messages-separator .text-center {
    background-color: var(--bg-color);
    padding: 0 1rem;
    position: relative;
    top: -0.7rem;
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    left: 50%;
    transform: translateX(-50%);
}

/* Dropdown submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    border-radius: 0.375rem;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    content: "▶";
    border: none;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Burger menu styles */
.navbar-toggler {
    border: none;
    background: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
