:root {
    --fb-bg: #F0F2F5;
    --fb-white: #FFFFFF;
    --fb-blue: #1877F2;
    --fb-blue-hover: #166FE5;
    --fb-purple: #912e97;
    --fb-purple-light: #f8eefb;
    --fb-text: #050505;
    --fb-gray: #65676B;
    --fb-border: #CED0D4;
    --fb-red: #FF4B4B;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--fb-bg);
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--fb-text);
    overflow-y: scroll;
}

.material-symbols-outlined {
    font-size: 20px;
    vertical-align: middle;
    margin-right: 8px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: 0.2s;
    display: inline-block;
}

.navbar {
    background: var(--fb-white);
    height: 56px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.ai-greeting {
    color: #65676B;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 0px;
    transition: 0.3s;
    cursor: default;
    user-select: none;
}

.ai-greeting .material-symbols-outlined {
    color: var(--fb-purple);
    font-size: 24px;
}

.ai-greeting:hover {
    color: var(--fb-purple);
}

.nav-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: block;
}

.logo-text {
    color: var(--fb-blue);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-coffee-mobile {
    display: none !important;
}

.main-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
    gap: 32px;
    align-items: flex-start;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
}

.feed {
    flex-grow: 1;
    max-width: 600px;
}

.fb-card {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.header-text {
    font-weight: 700;
    font-size: 18px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-meta {
    font-size: 13px;
    color: var(--fb-gray);
}

.result-title {
    font-size: 16px;
    margin: 5px 0 10px 0;
    font-weight: normal;
    line-height: 1.4;
}

.image-container {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    background: #f0f2f5;
    line-height: 0;
    border-top: 1px solid #E4E6EB;
    border-bottom: 1px solid #E4E6EB;
    overflow: hidden;
}

.result-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.result-img:hover {
    transform: scale(1.02);
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
}

.price-tag {
    font-size: 22px;
    font-weight: 800;
    color: var(--fb-text);
}

.btn-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1877F2 0%, #0056b3 100%);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-check .arrow {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease-in-out;
}

.btn-check:hover {
    background: linear-gradient(135deg, #2d8bf7 0%, #0062cc 100%);
}

.btn-check:hover .arrow {
    transform: translateX(5px);
}

.btn-check:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #166fd8 0%, #004a99 100%);
}

.btn-check::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-25deg);
    transition: 0.6s ease;
}

.btn-check:hover::after {
    left: 150%;
}

.promo-card {
    text-align: center;
    border: 1px solid white;
    transition: border 0.2s;
}

.promo-card:hover {
    border: 1px solid var(--fb-border);
}

.promo-label {
    text-align: left;
    font-size: 13px;
    font-weight: bold;
    color: var(--fb-purple);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.promo-image-box {
    position: relative;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.promo-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--fb-purple);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.promo-title {
    font-size: 16px;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.promo-desc {
    font-size: 13px;
    color: var(--fb-gray);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.promo-pricing {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.old-price {
    text-decoration: line-through;
    color: var(--fb-gray);
    font-size: 14px;
}

.new-price {
    color: var(--fb-text);
    font-weight: 800;
    font-size: 18px;
}

.btn-promo {
    display: block;
    width: 100%;
    background: #e4e6eb;
    color: black;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.btn-promo:hover {
    background: #d0d2d8;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-gray);
    margin-bottom: 12px;
}

select {
    width: 100%;
    padding: 12px 40px 12px 12px;
    background-color: #F0F2F5;
    border: 1px solid #E4E6EB;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2365676B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select:focus {
    border-color: var(--fb-purple);
    background-color: #fff;
}

.price-bold {
    color: var(--fb-purple);
    font-weight: 700;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #E4E6EB;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

.tag:hover {
    background: #d0d2d8;
}

.tag.active {
    background: var(--fb-purple-light);
    color: var(--fb-purple);
    border: 1px solid var(--fb-purple);
}

.tag.active .material-symbols-outlined {
    color: var(--fb-purple);
    font-variation-settings: 'FILL' 1;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, #1877F2 0%, #0056b3 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn-primary .material-symbols-outlined {
    transition: transform 0.3s ease-in-out;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d8bf7 0%, #0062cc 100%);
}

.btn-primary:hover .material-symbols-outlined {
    transform: rotate(45deg) scale(1.1);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: 0.6s ease;
}

.btn-primary:hover::after {
    left: 150%;
}

.btn-primary:disabled {
    background: #bcc0c4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled::after {
    display: none;
}

.btn-secondary {
    background: #E4E6EB;
    color: #050505;
    border: none;
    transition: 0.2s;
    font-weight: 600;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: #d0d2d8;
}

.btn-coffee {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFDD00;
    color: black;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 10px;
    transition: 0.2s;
    text-align: center;
}

.btn-coffee:hover {
    background: #e6c700;
}

.range-wrapper {
    padding: 10px 5px;
}

.range-container {
    position: relative;
    width: 100%;
    height: 6px;
    margin: 15px 0 25px 0;
}

.range-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #E4E6EB;
    border-radius: 3px;
    z-index: 1;
}

.range-container input[type="range"] {
    position: absolute;
    width: 100%;
    top: -7px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    margin: 0;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--fb-blue);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
}

.range-container input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--fb-blue);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: auto;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    animation: modalSlide .3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-weight: 700;
    font-size: 20px;
}

.modal-title .material-symbols-outlined {
    color: var(--fb-purple);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--fb-gray);
    line-height: 1;
}

#ideaText {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 15px;
    resize: none;
    outline: none;
}

#ideaText:focus {
    border-color: var(--fb-purple);
}

@media(max-width:900px) {
    .sidebar {
        display: none;
    }
    .nav-center {
        display: none;
    }
    .nav-coffee-mobile {
        display: flex !important;
        align-items: center;
        padding: 6px 12px !important;
        font-size: 12px !important;
        height: 32px;
        margin-top: 0 !important;
        white-space: nowrap;
    }
    .main-container {
        padding: 10px;
        margin: 0;
    }
    .feed {
        width: 100%;
        max-width: 100%;
    }
    .logo-text {
        font-size: 18px;
    }
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    .nav-content {
        justify-content: space-between;
    }
}

.loading-summary {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    display: inline-block;
    min-width: 250px;
    animation: fadeIn .5s ease;
}

.loading-summary p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-summary strong {
    color: #fff;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877F2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.gift-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    overflow: hidden;
    animation: slideUp .4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hunt-btn:disabled {
    background-color: #bcc0c4;
    cursor: not-allowed;
}

.match-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e7f3ff;
    color: #1877f2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(24, 119, 242, 0.2);
    z-index: 10;
}

.match-badge-gold {
    background: #fff9e6;
    color: #f5b800;
    border-color: #f5b800;
}

.store-logo {
    height: 24px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    filter: grayscale(0.2);
    transition: filter .3s ease;
    vertical-align: middle;
}

.result-footer:hover .store-logo {
    filter: grayscale(0);
}

.help-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background-color: #E4E6EB;
    color: #65676B;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.help-fab-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 28px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.help-fab:hover,
.help-fab.active {
    background-color: #1877F2;
    color: white;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 24px rgba(24, 119, 242, 0.4);
}

.help-modal-content {
    max-width: 500px;
}

.help-steps {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 14px;
    color: #4B4F56;
    line-height: 1.5;
}

.step-number {
    background: #e7f3ff;
    color: #1877F2;
    font-weight: bold;
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    border: 2px solid #1877F2;
}

.help-step strong {
    color: #1c1e21;
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.help-modal-icon {
    color: var(--fb-blue);
}

.help-modal-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media(max-width:768px) {
    .help-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

@media(max-width:768px) {
    #helpFab,
    #helpModal {
        display: none !important;
    }
}
/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #E4E6EB;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 9999;
    display: none; /* Domyślnie ukryty, JS go pokaże jeśli trzeba */
    backdrop-filter: blur(5px);
    animation: slideUpCookie 0.5s ease-out;
}

@keyframes slideUpCookie {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    font-size: 14px;
    color: #4B4F56;
    line-height: 1.4;
}

.btn-cookie-ok {
    background: #1877F2;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-cookie-ok:hover {
    background: #166FE5;
}

/* Responsywność na telefony */
@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .btn-cookie-ok {
        width: 100%;
    }
}
