* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #ff7e67; /* Warm Coral */
    --primary-dark: #e8634c; /* Darker Coral */
    --primary-light: #fff0e6; /* Soft Peach */
    --primary-shadow: rgba(232, 99, 76, 0.25);
    --primary-shadow-light: rgba(255, 126, 103, 0.2);
    --primary-shadow-strong: rgba(232, 99, 76, 0.35);
    --primary-border: rgba(232, 99, 76, 0.15);
    --bg-gradient: #fbfbfd; /* Clean off-white background */
    --card-bg: #ffffff;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --health-bg: #fff3e0; /* Soft orange for health */
    --health-text: #e67e22; /* Dark orange */
}

/* Blue Theme */
:root[data-theme="blue"] {
    --primary: #4facfe;
    --primary-dark: #278ee8;
    --primary-light: #e6f2ff;
    --primary-shadow: rgba(39, 142, 232, 0.25);
    --primary-shadow-light: rgba(79, 172, 254, 0.2);
    --primary-shadow-strong: rgba(39, 142, 232, 0.35);
    --primary-border: rgba(39, 142, 232, 0.15);
    --health-bg: #e6f2ff;
    --health-text: #278ee8;
}

/* Green Theme */
:root[data-theme="green"] {
    --primary: #2bc06a;
    --primary-dark: #1b9b50;
    --primary-light: #e6f9ec;
    --primary-shadow: rgba(27, 155, 80, 0.25);
    --primary-shadow-light: rgba(43, 192, 106, 0.2);
    --primary-shadow-strong: rgba(27, 155, 80, 0.35);
    --primary-border: rgba(27, 155, 80, 0.15);
    --health-bg: #e6f9ec;
    --health-text: #1b9b50;
}

/* Pink Theme */
:root[data-theme="pink"] {
    --primary: #ff758c;
    --primary-dark: #ff5e78;
    --primary-light: #ffeaf0;
    --primary-shadow: rgba(255, 94, 120, 0.25);
    --primary-shadow-light: rgba(255, 117, 140, 0.2);
    --primary-shadow-strong: rgba(255, 94, 120, 0.35);
    --primary-border: rgba(255, 94, 120, 0.15);
    --health-bg: #ffeaf0;
    --health-text: #ff5e78;
}

/* LOST EMERGENCY THEME (Overrides everything) */
:root[data-theme="lost"] {
    --primary: #d50000;
    --primary-dark: #b71c1c;
    --primary-light: #ffcdd2;
    --primary-shadow: rgba(213, 0, 0, 0.5);
    --primary-shadow-light: rgba(213, 0, 0, 0.3);
    --primary-shadow-strong: rgba(213, 0, 0, 0.7);
    --primary-border: rgba(213, 0, 0, 0.3);
    --bg-gradient: #fff0f0;
    --health-bg: #ffebee;
    --health-text: #b71c1c;
}

/* Red Theme */
:root[data-theme="red"] {
    --primary: #ff4b2b;
    --primary-dark: #e03a1a;
    --primary-light: #ffece8;
    --primary-shadow: rgba(224, 58, 26, 0.25);
    --primary-shadow-light: rgba(255, 75, 43, 0.2);
    --primary-shadow-strong: rgba(224, 58, 26, 0.35);
    --primary-border: rgba(224, 58, 26, 0.15);
    --health-bg: #ffece8;
    --health-text: #e03a1a;
}

/* Purple Theme */
:root[data-theme="purple"] {
    --primary: #a18cd1;
    --primary-dark: #8e73c8;
    --primary-light: #f4effa;
    --primary-shadow: rgba(142, 115, 200, 0.25);
    --primary-shadow-light: rgba(161, 140, 209, 0.2);
    --primary-shadow-strong: rgba(142, 115, 200, 0.35);
    --primary-border: rgba(142, 115, 200, 0.15);
    --health-bg: #f4effa;
    --health-text: #8e73c8;
}

/* Gray Theme */
:root[data-theme="gray"] {
    --primary: #8793a0;
    --primary-dark: #6c7a89;
    --primary-light: #f0f2f5;
    --primary-shadow: rgba(108, 122, 137, 0.25);
    --primary-shadow-light: rgba(135, 147, 160, 0.2);
    --primary-shadow-strong: rgba(108, 122, 137, 0.35);
    --primary-border: rgba(108, 122, 137, 0.15);
    --health-bg: #f0f2f5;
    --health-text: #6c7a89;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Usuwa brzydkie miganie przy tapnięciu na telefonie */
}

html {
    height: -webkit-fill-available;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    display: block;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    padding-bottom: 60px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure consistent font across all form elements */
button, input, select, textarea {
    font-family: 'Outfit', sans-serif !important;
}

/* Zapobieganie ucinaniu tekstów w całym systemie */
h1, h2, h3, h4, h5, h6, p, span, div {
    max-width: 100%;
}

/* Luksusowy, dyskretny wzór w tle - poprawiony na fixed */
body::before {
    content: '';
    position: fixed; /* Zmieniono na fixed, aby zawsze pokrywało tło */
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--primary-light) 2px, transparent 2px);
    background-size: 32px 32px;
    opacity: 0.6;
    z-index: -1;
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 3rem;
    color: var(--primary);
    backdrop-filter: blur(10px);
}

.paw-loader {
    animation: bounce 1s infinite alternate cubic-bezier(0.5, 0.05, 1, 0.5);
}

@keyframes bounce {
    0% { transform: translateY(0); text-shadow: 0 10px 10px var(--primary-shadow-light); }
    100% { transform: translateY(-20px); text-shadow: 0 30px 20px var(--primary-border); }
}

.hidden {
    display: none !important;
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto; /* Najbardziej stabilne centrowanie w osi X */
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    padding-bottom: 0.5rem;
}

/* Header Background */
.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110px; /* Jeszcze niżej z 130px */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-bottom-left-radius: 50% 15%;
    border-bottom-right-radius: 50% 15%;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--primary-shadow-light);
}

/* Paw prints scattered on the header */
.header-bg .paw, .dashboard-header .paw {
    position: absolute;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

/* --- App Logo Styles --- */
.app-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: white;
}

.login-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 5;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: white;
}

/* adjust paws */
.header-bg .paw:nth-child(1), .dashboard-header .paw:nth-child(1) { font-size: 1.6rem; top: 10%; left: 8%; transform: rotate(-30deg); }
.header-bg .paw:nth-child(2), .dashboard-header .paw:nth-child(2) { font-size: 1.2rem; top: 35%; left: 18%; transform: rotate(-15deg); }
.header-bg .paw:nth-child(3), .dashboard-header .paw:nth-child(3) { font-size: 2rem; top: 15%; right: 12%; transform: rotate(20deg); }
.header-bg .paw:nth-child(4), .dashboard-header .paw:nth-child(4) { font-size: 1.1rem; top: 50%; right: 22%; transform: rotate(35deg); }
.header-bg .paw:nth-child(5), .dashboard-header .paw:nth-child(5) { font-size: 1.4rem; top: 45%; left: 6%; transform: rotate(-10deg); }
.header-bg .paw:nth-child(6), .dashboard-header .paw:nth-child(6) { font-size: 1.3rem; top: 25%; right: 35%; transform: rotate(10deg); }


/* Main Content */
.profile-header {
    position: relative;
    text-align: center;
    padding-top: 110px;
    margin-bottom: 1.5rem;
    z-index: 2;
}

.profile-content {
    position: relative;
    z-index: 5; /* Above header-bg */
    padding: 0 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Top Profile Section */
.profile-top {
    text-align: center;
    margin-top: 60px; /* Push down to overlap curve */
    animation: slideDown 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-outer-ring {
    width: 140px;
    height: 140px;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
    padding: 6px;
    box-shadow: 0 10px 30px var(--primary-shadow);
}

.image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    padding: 4px;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.name-like-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.2rem;
}

.dog-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.like-button {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
}

.like-button:active {
    transform: scale(0.85);
}

.like-button.liked {
    background: #ff4757;
    color: white;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

.like-button.liked i {
    animation: heartBeat 0.5s ease-in-out;
}

.dog-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.dog-subtitle i {
    color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0 1rem 0;
    width: 100%;
}

@media screen and (max-width: 360px) {
    .action-buttons {
        gap: 0.6rem;
    }
    .action-buttons .btn-action {
        padding: 1rem 1.2rem;
        font-size: 1rem;
        flex: 1;
        min-width: 130px;
    }
}

.btn-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 1.1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 8px 20px var(--primary-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 1;
    max-width: 200px;
    border: none;
    cursor: pointer;
}

.btn-action:active {
    transform: scale(0.96);
    box-shadow: 0 4px 10px var(--primary-shadow-light);
}

.btn-call {
    background: white;
    color: var(--primary-dark);
    border: 2px solid var(--primary-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-call:active {
    background: var(--primary-light);
    transform: scale(0.96);
}

.btn-call i {
    animation: shake 2.5s infinite ease-in-out;
}

.btn-message {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px var(--primary-shadow-strong);
}

.btn-message:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px var(--primary-shadow-light);
}

.btn-message i {
    animation: bounceSms 2.5s infinite ease-in-out;
}

.phone-display {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.8rem;
    margin-bottom: 2rem;
}

/* Traits Section */
.traits-container {
    margin-bottom: 1.8rem;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.1s;
}

.traits-container h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    text-align: center;
}

.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.trait-tag {
    background: var(--card-bg);
    color: var(--primary-dark);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid var(--primary-border);
}

/* Info Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.15s;
    padding-bottom: 1.2rem;
}

.info-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 1.4rem;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s;
}

.info-item:active {
    transform: scale(0.98);
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    margin-right: 1.2rem;
    flex-shrink: 0;
}

.health-icon {
    background: var(--health-bg);
    color: var(--health-text);
}

.owner-icon {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.info-text h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.info-text p {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
}

/* Bottom Actions */
.bottom-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media screen and (max-width: 360px) {
    .bottom-actions {
        gap: 0.5rem;
    }
    .btn-outline {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-light);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-outline:active {
    background: var(--primary-light);
    transform: scale(0.96);
}

footer {
    text-align: center;
    padding: 1rem 1rem 0.5rem;
    font-size: 0.9rem;
    z-index: 5;
    position: relative;
}

.footer-link {
    color: var(--text-muted);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-link:hover, .footer-link:active {
    color: var(--primary-dark);
}

/* Floating Store Button */
.floating-store-btn {
    position: fixed;
    bottom: 20px;
    right: calc(50% - 240px); /* Align with the right edge of the app-container (max-width 480px) */
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-top-left-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    text-decoration: none;
    box-shadow: -4px -4px 15px var(--primary-shadow-strong);
    z-index: 100;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    animation: fadeInUp 0.5s ease backwards 0.8s;
}

@media (max-width: 480px) {
    .floating-store-btn {
        right: 0;
        bottom: env(safe-area-inset-bottom, 0);
    }
}

.floating-store-btn i {
    transform: translate(8px, 8px); /* Center visually in the meat of the quarter-circle */
}

.floating-store-btn:active {
    transform: scale(0.95);
    box-shadow: -2px -2px 10px var(--primary-shadow-light);
}

/* Animations */
@keyframes slideDown {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

@keyframes shake {
    0%, 80%, 100% { transform: rotate(0deg); }
    85%, 95% { transform: rotate(15deg); }
    90% { transform: rotate(-15deg); }
}

@keyframes bounceSms {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Settings Button */
.settings-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    z-index: 100;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.settings-btn:active {
    transform: scale(0.9);
}

/* Owner Badge */
.owner-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s ease backwards;
}

/* Color Modal */
.color-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.color-modal {
    background: var(--card-bg);
    padding: 2.2rem 1.2rem 1.5rem;
    border-radius: 32px;
    width: 92%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    /* Reverted overflow: auto to visible to prevent clipping top icons */
    overflow: visible;
}

/* Specific scrollable state for the long settings modal */
#settingsModalOverlay .color-modal {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

#settingsModalOverlay .color-modal::-webkit-scrollbar {
    display: none;
}

.color-modal-overlay.active .color-modal {
    transform: scale(1);
}

.color-modal h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.modal-title {
    margin-bottom: 1.2rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
}

.edit-modal-content {
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    padding: 1.5rem;
}

@media (max-width: 500px) {
    .edit-modal-content {
        width: 95%;
        padding: 1.2rem;
        max-height: 90vh;
    }
}

.center-text { text-align: center; }
.btn-small-text { 
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.85rem; 
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.6rem 1rem;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-small-text:hover {
    color: var(--text-dark);
    opacity: 0.8;
}
.mt-1 { margin-top: 1rem !important; }
.mt-05 { margin-top: 0.5rem !important; }

.settings-section {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.settings-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}
.auth-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.auth-hint strong { color: var(--text-dark); }

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    border: 3px solid transparent;
}

.color-circle:active {
    transform: scale(0.9);
}

.color-circle.active {
    border-color: var(--text-dark);
    transform: scale(1.1);
}

/* Colors for modal circles */
.c-orange { background: #ff7e67; }
.c-blue { background: #4facfe; }
.c-green { background: #2bc06a; }
.c-pink { background: #ff758c; }
.c-red { background: #ff4b2b; }
.c-purple { background: #a18cd1; }
.c-gray { background: #8793a0; }

.modal-close {
    margin-top: 1.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-close-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.modal-close-icon:hover {
    background: var(--primary-shadow-light);
}

.modal-close-icon:active {
    transform: scale(0.9);
}

/* --- Step Counter Styles --- */
.steps-container {
    background: white;
    padding: 1.5rem;
    border-radius: 28px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
}

.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.steps-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}

.step-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.85rem;
}

.walk-toggle-card {
    background: #f8f9fa;
    padding: 1rem 1.2rem;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.04);
}

.walk-info p {
    font-weight: 700;
    margin: 0;
    font-size: 0.95rem;
}

#walkDuration {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

.btn-walk-start {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.btn-walk-stop {
    background: #2d3436;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.activity-chart-container {
    margin-top: 1rem;
}

.chart-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.activity-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    padding-top: 10px;
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.chart-bar {
    width: 25px;
    background: var(--primary-light);
    border-radius: 6px 6px 2px 2px;
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    min-height: 4px;
}

.chart-bar.current {
    background: var(--primary);
}

.chart-day {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* --- Forum Styles --- */
.forum-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-gradient);
}

.forum-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px var(--primary-shadow-light);
    z-index: 10;
}

.forum-back-btn {
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    margin-right: 1rem;
    transition: transform 0.2s;
}

.forum-back-btn:active {
    transform: scale(0.9);
}

.forum-header-info {
    flex-grow: 1;
}

.forum-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.forum-header-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
}

.forum-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Custom scrollbar for webkit */
    scrollbar-width: none;
}

.forum-messages::-webkit-scrollbar {
    display: none;
}

.message-item {
    display: flex;
    gap: 0.8rem;
    max-width: 85%;
    animation: fadeInUp 0.3s ease-out forwards;
}

.message-item.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-item.theirs {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    border: 2px solid white;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.message-item.mine .message-author {
    text-align: right;
}

.message-bubble {
    padding: 0.8rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-break: break-word;
}

.message-item.theirs .message-bubble {
    background: var(--card-bg);
    color: var(--text-dark);
    border-top-left-radius: 4px;
    border: 1px solid rgba(0,0,0,0.03);
}

.message-item.mine .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 10px var(--primary-shadow-light);
}

.forum-bottom-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* --- Options Menu --- */
.options-menu {
    position: absolute;
    bottom: 100%;
    left: 1.5rem;
    margin-bottom: 0.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 200px;
    transform-origin: bottom left;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    transform: translateY(0) scale(1);
    border: 1px solid rgba(0,0,0,0.05);
}

.options-menu.hidden {
    display: flex !important; /* Override .hidden display:none to allow animation */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.option-btn:hover {
    background: rgba(0,0,0,0.03);
}

.opt-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
}

/* --- Emoji Bar --- */
.emoji-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.emoji-bar.hidden {
    display: none !important;
}

.emoji-bar::-webkit-scrollbar {
    display: none;
}

.emoji-btn {
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.2rem;
    transition: transform 0.1s;
    user-select: none;
}

.emoji-btn:active {
    transform: scale(0.8);
}

.forum-input-area {
    background: var(--card-bg);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
    flex-shrink: 0;
}

.forum-input {
    flex-grow: 1;
    min-width: 0;
    background: var(--bg-gradient);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 0.8rem 1.2rem;
    border-radius: 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.forum-input:focus {
    border-color: var(--primary-border);
    background: white;
}

.forum-send-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--primary-shadow-light);
    transition: transform 0.2s;
}

.forum-send-btn:active {
    transform: scale(0.9);
}

/* --- Login Styles --- */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: flex-start;
    background: var(--bg-gradient);
    overflow-y: auto;
    scrollbar-width: none;
    position: relative;
    padding-bottom: 0;
}
.login-container::-webkit-scrollbar {
    display: none;
}

.login-bg {
    height: 110px; /* Dopasowano do nowej wysokości nagłówka */
}

.login-content {
    position: relative;
    z-index: 5;
    padding: 0 20px; /* Używamy stałych pikseli dla pewności symetrii */
    margin-top: 35px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    width: 100%;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.2rem 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    text-align: center;
    margin-bottom: 1rem;
}

.login-card .image-outer-ring {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    padding: 8px;
    margin: -45px auto 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
    border: 4px solid var(--primary-light);
}

.login-card .image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

/* Kompaktowa lista zalet na landing page */
.landing-feature-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem; /* Zmniejszono z 2rem */
    text-align: left;
    font-size: 0.95rem;
}

.feature-item {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.6rem; /* Zmniejszono z 0.8rem */
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item i {
    color: var(--primary);
    font-size: 0.8rem;
    width: 14px;
    text-align: center;
}

.login-card h2 {
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    font-size: 1.4rem; /* Zmniejszono font */
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

/* Specyficzny widget dla dołu strony logowania */
.login-footer-bg {
    position: fixed; /* Zmieniono na fixed, aby zawsze przylegało do dołu ekranu */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px; /* Musi odpowiadać szerokości app-container */
    height: 110px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-top-left-radius: 50% 15%;
    border-top-right-radius: 50% 15%;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 -4px 20px var(--primary-shadow-light);
    pointer-events: none; /* Aby nie blokowała kliknięć jeśli najdzie na przyciski */
}

.login-footer-bg .paw {
    position: absolute;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.5rem;
}

/* --- Styl Map Tutorial (Premium Mobile) --- */
.tutorial-marker-preview {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.marker-pin-mini {
    width: 28px;
    height: 38px;
    background: var(--primary);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px var(--primary-shadow-light);
}

.marker-pin-mini i {
    transform: rotate(45deg);
    font-size: 10px;
    color: white;
}

.user-location-mini {
    width: 12px;
    height: 12px;
    background: #4facfe;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.3);
    margin: 6px auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group input {
    background: var(--bg-gradient);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.2s;
}

/* Kontener dla pola hasła - teraz to on tworzy "ramkę" */
.password-input-wrapper {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    background: var(--bg-gradient) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    border-radius: 12px !important;
    transition: all 0.2s !important;
    overflow: hidden;
}

.password-input-wrapper:focus-within {
    border-color: var(--primary) !important;
    background: white !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

.password-input-wrapper input {
    border: none !important; /* Usuwamy ramkę z samego inputa */
    background: transparent !important; /* Input jest przezroczysty */
    margin: 0 !important;
    flex: 1 !important;
    padding: 0.75rem 1rem !important;
    padding-right: 3rem !important;
    box-shadow: none !important;
}

.toggle-password {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    color: var(--primary) !important;
    cursor: pointer !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
    opacity: 0.8 !important;
    font-size: 1.1rem !important;
}

.toggle-password:focus {
    outline: none !important;
}

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

.form-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.2rem;
    line-height: 1.3;
}

.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.form-divider::before, .form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.form-divider span {
    padding: 0 10px;
}

.w-100 {
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: var(--bg-gradient);
    border-radius: 15px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.auth-error {
    background: linear-gradient(135deg, #fff5f5, #ffebee);
    color: #c62828;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid #ffcdd2;
    border-left: 4px solid #d32f2f;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.08);
}

.auth-success {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(21, 87, 36, 0.2);
    line-height: 1.4;
}

.loading-indicator {
    text-align: center;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.loading-indicator i {
    margin-right: 0.4rem;
}

/* Human Avatar on Forum */
.message-avatar.human-avatar {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.message-avatar.human-avatar i {
    transform: translateY(2px);
}

/* Logout Button */
.forum-logout-btn {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-logout-btn:hover, .forum-logout-btn:active {
    color: white;
    transform: scale(0.9);
}

/* --- Forum Header Actions Group --- */
.forum-header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.forum-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.forum-settings-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(60deg);
}

/* --- NFC Scan Button --- */
.nfc-scan-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.btn-nfc {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 14px;
    padding: 0.8rem 1.4rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all 0.2s;
}

.btn-nfc:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-nfc:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.nfc-hint {
    font-size: 0.78rem;
    color: #aaa;
    margin: 0;
}

.pet-id-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pet-id-input-wrapper input { flex: 1; }

.pet-id-status {
    position: absolute;
    right: 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
}

/* --- Settings Modal --- */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

.settings-modal-overlay.hidden { display: none; }

.settings-modal {
    background: var(--card-bg, #fff);
    border-radius: 24px 24px 16px 16px;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.25s ease;
}

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

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.settings-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-close-btn {
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.settings-close-btn:hover { background: rgba(0,0,0,0.12); }

.settings-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.settings-hint {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.pet-id-pair-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-wrap: nowrap;
}

.pet-id-pair-row .forum-input {
    flex: 1;
    min-width: 0; /* zapobiega rozjeżdżaniu na mobilce */
}

.pet-id-pair-row button {
    flex-shrink: 0;
    padding: 0.7rem 0.9rem !important;
    white-space: nowrap;
    font-size: 0.85rem;
}

/* --- Paired Pet Card --- */
.paired-pet-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0,0,0,0.04);
    border-radius: 16px;
    padding: 0.7rem 0.8rem;
    overflow: hidden; /* nie wylewaj poza ramkę */
    box-sizing: border-box;
    width: 100%;
}

.paired-pet-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.paired-pet-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.paired-pet-info strong {
    font-size: 1rem;
    color: var(--primary-dark, #333);
}

.paired-pet-id-label {
    font-size: 0.78rem;
    color: #aaa;
}

.btn-unpair {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-unpair:hover { background: #cc0000; transform: scale(1.1); }

/* Aktywna karta psa */
.paired-pet-card.active-pet {
    background: rgba(var(--primary-rgb, 255,140,0), 0.12);
    border: 1.5px solid var(--primary);
}

/* Przycisk "pisz jako" */
.btn-select-pet {
    background: rgba(0,0,0,0.07);
    color: #666;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-select-pet.active {
    background: var(--primary);
    color: white;
}

.btn-select-pet:hover { opacity: 0.85; transform: scale(1.08); }

#pairedPetsList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

#noPetView {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

#hasPetView {
    margin-top: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Dymek informacyjny w chacie */
.chat-info-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #bbb;
    background: rgba(0,0,0,0.04);
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    margin: 0.5rem auto 0.8rem;
    width: fit-content;
    max-width: 90%;
    pointer-events: none;
    user-select: none;
}

/* Przycisk zdjęcia w chacie */
.forum-image-btn {
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.forum-image-btn:hover { background: rgba(0,0,0,0.12); color: var(--primary); }
.forum-image-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Zdjęcie w wiadomości */
.chat-image {
    max-width: 220px;
    max-height: 260px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
    margin-top: 0.3rem;
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.chat-image:hover { opacity: 0.9; }

/* Godzina wiadomości */
.message-time {
    font-size: 0.68rem;
    color: #bbb;
    margin-top: 0.2rem;
    display: block;
}

.message-item.mine .message-time { text-align: right; }
.message-item.theirs .message-time { text-align: left; }

/* --- Profile Chat Card --- */
.profile-chat-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.3rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-chat-card:active {
    transform: scale(0.97);
    background: rgba(0,0,0,0.06);
}

.profile-chat-card img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.profile-chat-card-info {
    display: flex;
    flex-direction: column;
}

.profile-chat-card-info strong {
    font-size: 0.95rem;
}

.profile-chat-card-info span {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

/* Responsive adaptations to fit content on screen without scrolling */
@media (max-height: 850px) {
    .header-bg { height: 130px; }
    .profile-top { margin-top: 45px; }
    .image-outer-ring { width: 120px; height: 120px; margin-bottom: 0.6rem; }
    .dog-name { font-size: 2rem; }
    .info-item { padding: 1rem; }
}

@media (max-height: 750px) {
    .header-bg { height: 100px; }
    .profile-top { margin-top: 30px; }
    .image-outer-ring { width: 100px; height: 100px; margin-bottom: 0.5rem; }
    .dog-name { font-size: 1.8rem; }
    .dog-subtitle { margin-bottom: 0.8rem; font-size: 0.95rem; }
    .action-buttons { margin-bottom: 0.2rem; }
    .btn-action { padding: 0.7rem 0.8rem; font-size: 0.95rem; }
    .traits-container { margin-bottom: 1rem; }
    .traits-container h3 { margin-bottom: 0.5rem; font-size: 0.8rem; }
    .info-sections { gap: 0.7rem; padding-bottom: 0.5rem; }
    .info-item { padding: 0.8rem; border-radius: 18px; }
    .info-icon { width: 42px; height: 42px; font-size: 1.1rem; margin-right: 0.8rem; }
    .info-text p { font-size: 1rem; }
    .bottom-actions { margin-top: 0.5rem; }
    .btn-outline { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
    footer { padding: 0.5rem 1rem 0.5rem; }
}

@media (max-height: 650px) {
    .header-bg { height: 75px; }
    .profile-top { margin-top: 15px; }
    .image-outer-ring { width: 85px; height: 85px; padding: 4px; margin-bottom: 0.4rem; }
    .dog-name { font-size: 1.5rem; }
    .like-button { padding: 0.25rem 0.6rem; font-size: 0.9rem; }
    .dog-subtitle { margin-bottom: 0.5rem; font-size: 0.85rem; }
    .action-buttons { gap: 0.5rem; }
    .btn-action { padding: 0.6rem; font-size: 0.85rem; }
    .traits-container { margin-bottom: 0.5rem; }
    .trait-tag { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
    .info-sections { gap: 0.4rem; padding-bottom: 0.3rem; }
    .info-item { padding: 0.5rem; border-radius: 12px; }
    .info-icon { width: 34px; height: 34px; font-size: 0.9rem; margin-right: 0.5rem; }
    .info-text h3 { font-size: 0.75rem; margin-bottom: 0.1rem; }
    .info-text p { font-size: 0.9rem; }
    .bottom-actions { margin-top: 0.3rem; gap: 0.6rem; }
    .btn-outline { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
    footer { padding: 0.3rem 1rem 0.3rem; }
    .floating-store-btn { width: 60px; height: 60px; font-size: 1.3rem; }
    .floating-store-btn i { transform: translate(6px, 6px); }
    .settings-btn { top: 10px; right: 10px; width: 35px; height: 35px; font-size: 1rem; }
}

@media (max-height: 560px) {
    html { font-size: 14px; }
    .header-bg { height: 60px; }
    .profile-top { margin-top: 10px; }
    .image-outer-ring { width: 70px; height: 70px; margin-bottom: 0.3rem; padding: 3px; }
    .dog-name { font-size: 1.3rem; }
    .dog-subtitle { margin-bottom: 0.3rem; font-size: 0.75rem; }
    .action-buttons { gap: 0.4rem; }
    .btn-action { padding: 0.35rem 0.5rem; font-size: 0.7rem; }
    .traits-list { gap: 0.4rem; }
    .trait-tag { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
    .info-sections { gap: 0.3rem; }
    .info-item { padding: 0.35rem; border-radius: 10px; }
    .info-icon { width: 26px; height: 26px; font-size: 0.75rem; margin-right: 0.4rem; }
    .info-text p { font-size: 0.8rem; }
    .info-text h3 { font-size: 0.7rem; }
    .bottom-actions { margin-top: 0.2rem; }
    .btn-outline { padding: 0.4rem 0.7rem; font-size: 0.75rem; border-width: 1.5px; }
    footer { padding: 0.2rem 1rem; font-size: 0.75rem; }
}

/* --- Micro-animations --- */
.heart-particle {
    position: fixed;
    color: #ff5e78;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatUpHeart 1s ease-out forwards;
    z-index: 1000;
}

@keyframes floatUpHeart {
    0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
    50% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1.2); }
    100% { transform: translate(var(--dx), calc(var(--dy) - 30px)) scale(1); opacity: 0; }
}

.paw-confetti {
    position: fixed;
    color: var(--primary);
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 9999;
    animation: fallDownPaw var(--duration) ease-in forwards;
}

@keyframes fallDownPaw {
    0% { transform: translate(var(--startX), -50px) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--endX), 100vh) rotate(var(--rot)); opacity: 0; }
}

/* --- Edit Profile Form Styles --- */
.edit-form .edit-group {
    margin-bottom: 1rem;
}
.edit-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.edit-form .form-input, .edit-form .form-textarea {
    width: 100%;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.2s;
}
.edit-form .form-input:focus, .edit-form .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-shadow-light);
}
.edit-form .form-textarea {
    resize: vertical;
    min-height: 80px;
}
.edit-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.edit-image-preview img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

/* --- Dashboard Styles --- */
.dashboard-container {
    background-color: var(--bg-light);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto; /* Pozwalamy na scroll, jeśli treść się nie mieści */
    padding-top: 0 !important;
}

.dashboard-container #loggedInState {
    display: block;
    min-height: auto;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem 1.5rem 1.5rem; /* Zmniejszone padding-top */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: -10px !important; /* Wymuszamy nakładanie się na górę aby zlikwidować lukę */
    padding-top: 2.5rem !important; /* Kompensujemy ujemny margines większym odstępem wewnątrz */
    width: 100%;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.header-titles h2 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.header-titles p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logout-dash-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: transform 0.2s;
}

.logout-dash-btn:active {
    transform: scale(0.9);
}

.dashboard-content {
    display: block;
    padding: 2rem 1.5rem 0;
}

.dashboard-section-title {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pets-grid {
    display: block;
    margin-bottom: 1.5rem;
}

.pets-grid::-webkit-scrollbar {
    display: none;
}

.pets-grid:empty {
    display: none;
}

#addAnotherPetBtn {
    flex-shrink: 0;
    margin-bottom: 1.5rem;
    border: none !important;
    outline: none !important;
}

.pet-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    min-width: 0; /* Zapobiega wypychaniu kontenera przez flex-child */
}

.pet-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.pet-card-info-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap; /* Kluczowe: pozwala etykiecie "Alarm" przeskoczyć niżej jeśli mało miejsca */
}

.pet-card-info h4 {
    font-size: 1rem;
    margin: 0;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-card-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pet-card-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0; /* Przyciski nie powinny się zgniatać */
}

.pet-card-edit-btn {
    background: var(--primary-light);
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pet-card-edit-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #2bc06a;
    background: rgba(43, 192, 106, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #2bc06a;
    border-radius: 50%;
    animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(43, 192, 106, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(43, 192, 106, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(43, 192, 106, 0); }
}

.status-alarm {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
}

.status-dot-alarm {
    width: 6px;
    height: 6px;
    background-color: #d32f2f;
    border-radius: 50%;
    animation: pulseAlarm 1s infinite;
}

@keyframes pulseAlarm {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(211, 47, 47, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

.pet-card.alarm-active {
    border: 2px solid #ffcdd2;
    background: #fff8f8;
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.1);
}

.pet-card.alarm-active img {
    border-color: #ffcdd2;
}

.pet-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pet-card img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.pet-card-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.pet-card-info span {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.empty-icon {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* --- Promo Banner Small --- */
.promo-banner-small {
    position: relative;
    margin-top: 1rem;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.03);
    z-index: 100;
    transition: transform 0.2s;
}

.promo-banner-small:active {
    transform: scale(0.98);
}

.promo-icon-bg {
    background: white; /* Białe tło dla logo */
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.promo-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-content-small {
    flex-grow: 1;
}

.promo-content-small h4 {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.promo-content-small p {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 0;
}

.promo-arrow {
    color: var(--primary);
    font-size: 0.9rem;
}


/* --- NFC Radar Styles --- */
.radar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-icon {
    font-size: 2.5rem;
    color: var(--primary);
    position: relative;
    z-index: 10;
}

.radar-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-light);
    opacity: 0;
    animation: pulseRadar 2s cubic-bezier(0.21, 0.53, 0.56, 1) infinite;
}

.radar-circle.delay-1 {
    animation-delay: 0.6s;
}

.radar-circle.delay-2 {
    animation-delay: 1.2s;
}

@keyframes pulseRadar {
    0% { transform: scale(0.3); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* --- Lost Mode 2.0 (Emergency Info & Animations) --- */
.lost-emergency-container {
    background: linear-gradient(135deg, #d50000, #b71c1c);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(213, 0, 0, 0.4);
    animation: slideUpFade 0.5s ease-out;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.emergency-icon {
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 1rem;
    display: inline-block;
}

.pulse-alarm {
    animation: heartBeatAlarm 1s infinite;
}

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

.lost-emergency-container h2 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.lost-emergency-container p {
    font-size: 1.05rem;
    line-height: 1.5;
    opacity: 0.95;
    margin: 0;
    font-weight: 500;
}

.lost-pulse-ring {
    background: #d50000 !important;
    border: 4px solid #ff1744 !important;
    animation: pulseOuterRingAlarm 1.2s infinite !important;
}

@keyframes pulseOuterRingAlarm {
    0% { box-shadow: 0 0 0 0 rgba(213, 0, 0, 0.8); }
    70% { box-shadow: 0 0 0 25px rgba(213, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(213, 0, 0, 0); }
}

/* Toggle Switch Styling (dla ustawień) */
.lost-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff5f5;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #ffcdd2;
    margin-top: 1rem;
}

.lost-toggle-info label { margin: 0; color: #b71c1c; font-weight: 700; }
.lost-toggle-info p { font-size: 0.75rem; color: #e57373; margin: 0; }

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #d32f2f; }
input:checked + .slider:before { transform: translateX(24px); }


/* --- Location Button in Pet Card --- */
.pet-card-location-btn {
    background: #e6f7ff;
    color: #1890ff;
    padding: 0 8px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #91d5ff;
}

.btn-label-inline {
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 5px;
}

.alarm-pulse {
    animation: alarmPulseBtn 1.5s infinite;
}

@keyframes alarmPulseBtn {
    0% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(24, 144, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0); }
}

.pet-card-location-btn:hover {
    background: #1890ff;
    color: white;
}

.widget-select-item {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
    background: #f8f9fa !important;
    border-radius: 18px !important;
    text-decoration: none !important;
    color: var(--text-dark) !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    margin-bottom: 0.5rem !important;
    width: 100% !important;
}

.widget-select-item:active {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    transform: scale(0.98);
}

.widget-select-item img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}


/* --- Tracking Page Styles --- */
.tracking-body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tracking-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.back-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.tracking-pet-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tracking-avatar-container img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid white;
}

.tracking-titles h2 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 800;
}



/* GPS Status Indicator */
.gps-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.gps-status-indicator.inactive {
    background: #f5f5f5;
    color: #8c8c8c;
}

.gps-status-indicator.loading-gps {
    background: #fffbe6;
    color: #faad14;
}

.gps-status-indicator.active-gps {
    background: #e6f7ff;
    color: #1890ff;
}

.gps-status-indicator i {
    font-size: 0.8rem;
}

#map {
    flex: 1;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.location-info-card {
    position: absolute;
    bottom: 1rem;
    left: 0.8rem;
    right: 0.8rem;
    z-index: 1000;
    background: white;
    padding: 0.8rem; /* Zmniejszono z 1rem */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 55vh; /* Zwiększono z 35vh */
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pomniejszenie dla małych ekranów */
@media screen and (max-height: 680px) {
    .location-info-card {
        padding: 0.8rem;
        bottom: 0.5rem;
    }
    .info-item {
        margin-bottom: 0.6rem;
    }
    .info-value {
        font-size: 0.9rem;
    }
}

.info-item {
    display: flex;
    gap: 0.8rem; /* Zmniejszono z 1rem */
    margin-bottom: 0.7rem; /* Zmniejszono z 1rem */
    align-items: flex-start;
}

.info-item i {
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 0.2rem;
}

.info-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* --- Marker Styles --- */
.marker-pin {
    width: 30px;
    height: 30px;
    min-width: 30px; /* Zapobiega spłaszczaniu */
    min-height: 30px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Kluczowe dla zachowania kształtu */
}

.marker-pin i {
    transform: rotate(45deg);
    color: white;
    font-size: 0.9rem;
}

.pulse-ring {
    border: 3px solid var(--primary);
    border-radius: 50%;
    height: 40px;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -20px;
    animation: pulsate 2s ease-out infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes pulsate {
    0% { transform: scale(0.1, 0.1); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.2, 1.2); opacity: 0; }
}

/* --- Przycisk Info w Nagłówku (i) - Clean Style --- */
.info-btn-circle {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto; /* Pcha przycisk do prawej krawędzi */
    margin-right: -0.2rem; /* Delikatna korekta odstępu od krawędzi */
}

.info-btn-circle:active {
    transform: scale(0.85);
    opacity: 0.7;
}

.info-btn-circle i {
    color: var(--primary); /* Kolor zgodny z motywem */
    font-size: 1.4rem; /* Nieco większa ikona dla lepszej klikalności */
}

/* --- Marker Container Fixes --- */
.user-div-icon {
    background: transparent !important;
    border: none !important;
    overflow: visible !important; /* Pozwala strzałce wystawać poza kontener */
}

/* --- User Location Marker (Classic Pulsing Dot - FIXED) --- */
.user-marker-ultimate {
    width: 20px;
    height: 20px;
    min-width: 20px !important;
    min-height: 20px !important;
    background: #007AFF;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.4);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* Efekt pulsowania */
.user-marker-ultimate::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.4);
    animation: simple-pulse 2s infinite;
    z-index: -1;
}

@keyframes simple-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}

/* Kropka w środku strzałki dla lepszej widoczności punktu */
.user-marker-wrapper::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    z-index: 2;
}

/* --- Gray Marker for History --- */
.marker-pin-gray {
    background: #8c8c8c !important;
    border-color: #f0f0f0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    opacity: 0.8;
}

/* --- Mobile Fixes & Layout Consistency --- */
.tracking-body {
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.tracking-header {
    background: white;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 10;
    flex-shrink: 0;
}

/* --- Custom Location Modal --- */
.modal-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
}

/* --- Custom Modal Base Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: opacity 0.3s;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 380px;
    border-radius: 28px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalPop 0.3s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.modal-icon.red {
    background: rgba(211, 47, 47, 0.1);
    color: #d32f2f;
    animation: modalIconPulseRed 2s infinite;
}

/* Zmieniamy klasę blue na themed, aby pasowała do wybranego koloru aplikacji */
.modal-icon.themed {
    background: var(--primary-light);
    color: var(--primary);
    animation: modalIconPulseThemed 2s infinite;
}

@keyframes modalIconPulseRed {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

@keyframes modalIconPulseThemed {
    0% { box-shadow: 0 0 0 0 var(--primary-shadow); }
    70% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* --- Modal Buttons Spread --- */
.modal-actions {
    display: flex !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-top: 1.5rem;
}
/* --- Media Queries dla małych ekranów --- */
@media screen and (max-width: 375px) {
    html {
        font-size: 14px; /* Globalne pomniejszenie całego interfejsu */
    }
    
    .app-container {
        padding-left: 0; /* Usunięcie paddingu który tworzył ramkę wokół nagłówka */
        padding-right: 0;
    }

    .dashboard-content, .profile-content, .login-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .pet-card {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .pet-card img {
        width: 45px;
        height: 45px;
    }

    .pet-card-actions {
        gap: 0.3rem;
    }

    .pet-card-edit-btn, .pet-card-unpair-btn, .pet-card-location-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 320px) {
    html {
        font-size: 12px;
    }
    
    .pet-card-actions {
        flex-direction: column;
        gap: 0.2rem;
    }

    /* Zmniejszenie marginesów sekcji na mikro ekranach */
    .profile-content, .dashboard-content, .login-content {
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }

    /* Dopasowanie formularzy */
    .form-group input {
        padding: 0.6rem 0.8rem;
    }
}

.back-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.pet-mini-card {
    background: white;
    padding: 1rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.pet-mini-card img {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    object-fit: cover;
}

.pet-mini-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.pet-mini-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Pairing Styles - Compact Premium Upgrade */
.pairing-status-card {
    background: #f0fdf4;
    color: #166534;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #bbf7d0;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.pairing-actions {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.btn-settings-action {
    flex: 1;
    background: #fcfcfd;
    border: 1.5px solid #f1f1f4;
    color: var(--text-dark);
    padding: 0.7rem 0.5rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    flex-direction: row; /* Zmieniono na poziom dla oszczędności miejsca */
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.btn-settings-action i {
    font-size: 1rem;
    color: var(--primary);
}

.btn-settings-action:active {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(1px);
}

.generated-code-box {
    background: white;
    padding: 0.8rem;
    border-radius: 16px;
    text-align: center;
    border: 2px dashed var(--primary-border);
    margin-bottom: 1rem;
    animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.code-display {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--primary);
    margin-top: 0.2rem;
}

.enter-code-box {
    display: flex;
    flex-direction: row; /* Powrót do układu poziomego, aby zaoszczędzić wysokość */
    gap: 0.5rem;
    margin-bottom: 1rem;
    animation: slideUpFade 0.3s ease-out;
}

.enter-code-box input {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid #f1f1f4;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 2px;
    background: #fcfcfd;
}

.enter-code-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.btn-primary-small {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 16px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-primary-small:active {
    transform: scale(0.96);
    box-shadow: none;
}

/* Modal Responsive Fixes */
@media screen and (max-height: 700px) {
    .color-modal {
        padding-top: 3rem;
    }
    .modal-title {
        font-size: 1.2rem;
    }
}
/* Motivation Card */
.motivation-card {
    background: #fff;
    border-radius: 24px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    margin-top: 0.2rem;
    animation: slideUp 0.6s ease-out;
}

.motivation-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.motivation-content h4 {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.motivation-content p {
    margin: 0.2rem 0 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}
