:root {
    --navy: #023047;
    --blue: #219EBC;
    --purple: #A434FF;
    --red: #EA3546;
    --orange: #FB8500;
    --yellow: #FFB703;
    --light-red: #FF5C5C;
    --light-blue: #8ecae6;

    --main-color: var(--purple);
    --main-color-light: #C77DFF;
    --second-color: var(--orange);
    --second-color-light: var(--yellow);

    --black: #080808;
    --dark: #023047;
    --light: #fff;
    --light-gray: #F7F4F2;

    --background: #f5f6fa;
    --background-wrapper-bg: #eeeced;
    --surface: #ffffff;
    --text-primary: #222;
    --text-secondary: #444;
    --accent: var(--main-color);
    --tag-bg: #eee;

    --heading-font: 'Rubik', sans-serif;
    --body-font: 'Roboto', sans-serif;
    --title-font: 'Fredoka One', cursive;
    --journal-bg: #f4f4f8;
    --stat-box-bg: #ffffff;
    --stat-text: #222;
    --stat-label: #888;
    --tab-bg: #ffffff;
    --tab-text: #333;
    --tag-bg: #eee;
    --journal-heading: #333;
    --journal-paragraph: #444;
    --tab-active-bg: #fff8b0;
    --tab-active-color: #000;
}

body.theme-dark {
    --background: var(--dark);
    --background-wrapper-bg: var(--dark);
    --surface: #1e1e2f;
    --text-primary: #ffffff;
    --text-secondary: #ccc;
    --accent: var(--main-color-light);
    --tag-bg: #333;
    --journal-bg: #32323f;
    --stat-box-bg: #2c2c3a;
    --stat-text: #ffffff;
    --stat-label: #ccc;
    --tab-bg: #3a3a4d;
    --tab-text: #f0f0f0;
    --tag-bg: #444;
    --journal-heading: #f0f0f0;
    --journal-paragraph: #cccccc;
    --tab-active-bg: #7d5fff;
    --tab-active-color: #fff;
}


body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f6fa;
}

/* === Layout === */
.background-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding-top: 0;
    position: relative;
}

.background-wrapper::before {
    content: "";
    background-color: #162f45;
    position: absolute;
    top: 0;
    left: 0;
    height: 500px;
    width: 100%;
    z-index: 1;
    border-bottom-left-radius: 30% 10%;
    border-bottom-right-radius: 30% 10%;
}

.profile-container {
    max-width: 430px;
    width: 100%;
    background-color: transparent;
    z-index: 2;
    position: relative;
}

/* === Profile Header === */
.profile-header {
    color: white;
    text-align: center;
    padding: 70px 20px 80px;
    position: relative;
}

.profile-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
}

.dog-header-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.profile-pic {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    display: block;
}

.qr-share-text {
    font-size: 13px;
    color: #e2e2e2;
    margin-top: 8px;
}

.profile-meta {
    color: #e2e2e2;
    font-size: 14px;
    margin-top: 6px;
}

/* === Dog Stats === */
.dog-stats-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
    color: #e2e2e2;
    padding-top: 10px;
}

.dog-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
}

.dog-stat .stat-title {
    font-size: 11px;
    color: rgb(124, 131, 153);
    margin-bottom: 2px;
}

.dog-stat .stat-value {
    font-weight: 700;
    color: rgb(124, 131, 153);
}

.stat-divider {
    border-right: 3px solid rgba(255, 255, 255, 0.2);
}

.dog-extra-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 200px;
    margin: 20px auto 0 auto;
    gap: 10px;
    text-align: center;
}

.dog-extra-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dog-extra-info .stat-title,
.dog-extra-info .stat-value {
    font-size: 11px;
    color: rgb(124, 131, 153);
}

/* === Stats Section === */
.stats-wrapper {
    position: relative;
    top: -50px;
    z-index: 2;
    padding: 0 16px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-box {
    background: var(--stat-box-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 26px;
    line-height: 1;
    text-align: center;
    margin-right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dce2ba;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--stat-text);
}

.stat-label {
    font-size: 11px;
    color: var(--stat-label);
    margin-top: 2px;
}

/* === Tabs === */
.tab-bar {
    margin-top: -30px;
    display: flex;
    justify-content: space-around;
    background: transparent;
}

.tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--tab-bg);
    border: none;
    font-size: 14px;
    color: var(--tab-text);
}

.tab.active {
    background-color: var(--tab-active-bg);
    color: var(--tab-active-color);
    font-weight: bold;
}

/* === Journal Section === */
.journal-entry {
    position: relative;
    margin: 16px;
    padding: 16px;
    background: var(--journal-bg);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding-bottom: 60px;
}

.journal-entry h3 {
    font-size: 16px;
    color: var(--journal-heading);
    margin-bottom: 4px;
}

.journal-entry p {
    margin: 6px 0;
    font-size: 14px;
    color: var(--journal-paragraph);
}


.tags {
    margin-top: 10px;
}

.tags span {
    background: var(--tag-bg);
    padding: 4px 8px;
    border-radius: 20px;
    margin: 2px;
    display: inline-block;
    font-size: 12px;
}

/* === Photos === */
.photos-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    width: 100%;
    height: 200px;
    margin-top: 10px;
}

.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.side-photos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-photos img {
    width: 100%;
    height: calc(50% - 4px);
    object-fit: cover;
    border-radius: 12px;
}

.xp-earned {
    font-size: 13px;
    color: #e3af00;
    font-weight: bold;
    margin-top: 8px;
}

/* === Share Button === */
.share-button-inside {
    position: absolute;
    bottom: 24px;
    right: 16px;
    z-index: 2;
}

.share-button-inside button {
    background-color: #953ff6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.share-button-inside button:hover {
    background-color: #7b33cd;
}

/* === Dropdown (Switch Profile) === */
.switch-profile-wrapper {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1000;
    transform-origin: top right;
}

.switch-profile-wrapper .dropdown-toggle {
    background: #ffffffcc;
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Rubik', sans-serif;
    height: 32px;
}

.switch-profile-wrapper .material-symbols-rounded {
    font-size: 15px;
}

.dropdown-menu {
    position: absolute;
    top: 40px;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    width: 140px;
}

.dropdown-menu a {
    padding: 8px 16px;
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

/* === Achievements === */
.achievement-summary {
    background: linear-gradient(to right, #6c5ce7, #00cec9);
    color: white;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    margin: 20px 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievement-summary h4 {
    font-size: 1.2rem;
    margin: 0;
}

.achievement-summary .highlight {
    font-weight: bold;
}

.achievement-progress {
    background: white;
    color: #6c5ce7;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
}

.achievement-section {
    margin-bottom: 1.2rem;
}

.achievement-section h5 {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    color: #2d3436;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px 12px;
}

.achievement {
    background: white;
    padding: 0.6rem 0.8rem 2.2rem;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: transform 0.15s ease-in-out;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.achievement:hover {
    transform: translateY(-3px);
}

.achievement .emoji {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.achievement .title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #2d3436;
}

.achievement small {
    font-size: 0.8rem;
    color: #636e72;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.achievement .share-achievement-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #a434ff;
    border: none;
    border-radius: 50%;
    color: white;
    padding: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.achievement .share-achievement-btn:hover {
    background: #c77dff;
    transform: scale(1.05);
}

.achievement .share-achievement-btn span {
    font-size: 20px;
    color: white;
}

/* Dark Mode Overrides */
.theme-dark .achievement-summary {
    background: linear-gradient(to right, #4834d4, #00b894);
    color: white;
}

.theme-dark .achievement-progress {
    background: #2d3436;
    color: #a29bfe;
}

.theme-dark .achievement-section h5,
.theme-dark .achievement .title {
    color: #dfe6e9;
}

.theme-dark .achievement {
    background: #2f3640;
    box-shadow: 0 1px 5px rgba(255, 255, 255, 0.05);
}

.theme-dark .achievement small {
    color: #b2bec3;
}