/* File: public/css/public-profile.css */

/* --- IMPORT GREEN THEME FROM LAYOUT.CSS --- */


/* ------------------------------------------- */

.public-profile-container {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: var(--app-gap);
    position: relative;
    overflow: visible !important;
}

/* --- Global Responsive Table --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--app-gap);
    border-radius: var(--card-radius);
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
    padding: 15px;
    transition: all 0.3s ease;
}

html.dark-mode .table-responsive {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

/* .table-clean styles removed - inherited from global .mh-table system */

/* Zebra stripes & Center align removed - inherited from global .mh-table system */

/* Utils for visibility */
.show-on-desktop {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-on-desktop {
        display: none !important;
    }

    .show-on-mobile {
        display: block !important;
    }
}

/* --- Header Section (Clean & Modern) --- */
.profile-header {
    background: var(--bg-body);
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    margin-bottom: var(--app-gap);
    border: none;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark-mode .profile-header {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}



.profile-info-bar {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    /* Center align instead of end */
    position: relative;
    margin-top: 0;
    /* consistent padding */
}

.avatar-container {
    width: var(--avatar-size-xl);
    height: var(--avatar-size-xl);
    border-radius: 50%;
    border: 6px solid var(--bg-body);
    background: var(--bg-body);
    flex-shrink: 0;
    margin-right: 25px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-light);
    transition: var(--transition-bounce) !important;
}

html.dark-mode .avatar-container {
    border-color: var(--bg-body);
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Added to maintain circle shape */
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: var(--btn-height);
    height: var(--btn-height);
    background: var(--primary-color);
    border: 3px solid var(--bg-body);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.avatar-edit-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.3);
}

.user-details {
    flex: 1;
    padding-top: 10px;
}

.btn-follow {
    position: absolute;
    top: 25px;
    right: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    height: var(--btn-height);
    border-radius: 30px;
    border: none;
    background: var(--bg-body);
    color: var(--text-color);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 14px;
    z-index: 10;
}

html.dark-mode .btn-follow {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

.btn-follow:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    color: var(--primary-color);
}

html.dark-mode .btn-follow:hover {
    box-shadow: var(--shadow-light);
}

.btn-follow.following {
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: var(--btn-height);
    height: var(--btn-height);
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-follow.following:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Dark mode specific optimization for Following state */
html.dark-mode .btn-follow.following {
    background: rgba(46, 204, 113, 0.15);
    /* Light green tint for dark mode */
    color: var(--primary-color);
    border-color: var(--primary-color);
}

html.dark-mode .btn-follow.following:hover {
    background: rgba(46, 204, 113, 0.25);
    box-shadow: none;
}

.btn-follow .material-symbols-outlined {
    font-size: 18px;
}

.user-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.user-handle {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
}

.user-bio {
    margin-top: 10px;
    font-size: 15px;
    color: var(--text-color);
    max-width: 650px;
    line-height: 1.5;
}

.profile-stats-row {
    display: flex;
    gap: 40px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    opacity: 0.9;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-weight: 800;
    font-size: 20px;
    color: var(--text-color);
}

.stat-lbl {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Content Tabs (Clean Style) --- */
.clean-tabs-nav {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 55px !important;
    /* Dưới Navbar (55px) */
    background-color: var(--bg-body) !important;
    z-index: 999 !important;
    padding: 10px var(--app-side-padding);
}

.clean-tabs-nav::-webkit-scrollbar {
    display: none;
}

.clean-tab-link {
    background: none;
    border: none;
    padding: 12px 5px;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 600;
}

.clean-tab-link:hover {
    color: var(--primary-color);
}

.clean-tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.clean-tab-pane {
    display: none;
    opacity: 0;
}

.clean-tab-pane.active {
    display: block;
    animation: tabFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Social Feed Design --- */
.social-feed {
    max-width: 700px;
    /* Facebook feed width */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.social-post {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color-light);
    overflow: hidden;
    margin-bottom: var(--app-gap);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

html.dark-mode .social-post {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

html.dark-mode .social-post:hover {
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Post Header */
.post-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header-left {
    display: flex;
    align-items: center;
    /* Reduced from 12px */
}

.post-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    margin: 10px;
    flex-shrink: 0;
}

.post-follow-btn.followed {
    border-color: var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
}

.post-follow-btn.followed:hover {
    background: var(--bg-background);
    color: var(--text-color);
}

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

.post-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.post-menu-btn:hover {
    background: var(--bg-background);
    color: var(--text-color);
}

.post-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
    display: none;
    overflow: hidden;
}

.post-dropdown-menu.active {
    display: block;
}

.post-dropdown-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.post-dropdown-item:hover {
    background: var(--bg-background);
}

.post-dropdown-item.delete {
    color: var(--color-danger);
}

.post-dropdown-item.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* --- ADMIN EDIT MODAL --- */
.admin-edit-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1.5px);
}

/* Global Light Mode Modal Optimization: No blur as requested */
html:not(.dark-mode) .admin-edit-modal,
html:not(.dark-mode) .custom-modal-overlay,
html:not(.dark-mode) .modal-overlay,
html:not(.dark-mode) .modal {
    backdrop-filter: none !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.admin-edit-modal.active {
    display: flex;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-color);
}


/* Standard Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1.5px);
}

.modal-content-custom {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

html.dark-mode .modal-content,
html.dark-mode .modal-content-custom {
    box-shadow: var(--shadow-light) !important;
    background: rgba(45, 55, 72, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.modal-header-custom {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body-custom {
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
}

/* Likers List */
.liker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.liker-item:hover {
    background: var(--bg-hover);
}

.liker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.liker-info {
    display: flex;
    flex-direction: column;
}

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

.liker-username {
    font-size: 12px;
    color: var(--text-muted);
}

/* Icon Buttons */
.btn-icon-circle {
    width: var(--btn-height);
    height: var(--btn-height);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.btn-icon-circle.primary {
    background: var(--primary-color);
    color: white;
}

.btn-icon-circle.secondary {
    background: var(--bg-card);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-icon-circle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal-body textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}

.modal-body textarea:focus {
    border-color: var(--primary-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-cancel {
    background: var(--bg-body);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.post-avatar {
    width: var(--avatar-size-lg);
    height: var(--avatar-size-lg);
    border-radius: 50%;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author-line {
    font-size: 15px;
    color: var(--text-color);
}

.author-name {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.action-text {
    color: var(--text-muted);
}

.post-time {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Post Content */
.post-content {
    padding: 0 15px 15px 15px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
}

/* --- Mobile Header Redesign --- */
@media (max-width: 768px) {
    .profile-info-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
    }

    .avatar-container {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100px;
        height: 100px;
    }

    .user-details {
        width: 100%;
        padding-top: 0;
    }

    .user-name {
        justify-content: center;
        font-size: 24px;
        margin-bottom: 5px;
    }

    .user-handle {
        margin-bottom: 5px;
    }

    .profile-stats-row {
        margin-top: 15px;
        padding-top: 15px;
        justify-content: space-around;
        width: 100%;
        gap: 10px;
    }

    .btn-follow {
        top: 15px;
        right: 15px;
        padding: 4px 12px;
        font-size: 13px;
    }

    .btn-follow.following {
        width: 30px;
        height: 30px;
        padding: 0;
    }
}

/* Visual Snippet (The "Trade Card") */
.visual-snippet {
    margin: 0 15px 15px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

html.dark-mode .visual-snippet {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.visual-snippet:hover {
    background: var(--bg-hover);
}

/* Layout for Snippet */
.snippet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Equal Columns */
    align-items: center;
    padding: 15px;
    gap: 10px;
}

@media (max-width: 500px) {
    .snippet-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 15px;
    }
}

/* Common Column Style */
.snippet-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

@media (max-width: 500px) {
    .snippet-col {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        gap: 0;
    }

    /* Row 1: Symbol Left, Badge Right */
    .snippet-col:first-child .stock-symbol {
        order: 1;
        font-size: 16px;
    }

    .snippet-col:first-child .snippet-badge {
        order: 2;
        margin-bottom: 0;
    }
}

/* Middle Column Border */
.bordered-col {
    border-right: 1px solid var(--border-color);
}

@media (max-width: 500px) {
    .bordered-col {
        border: none;
        padding: 0;
    }
}

/* Elements inside columns */
.stock-symbol {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
}

.snippet-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

@media (max-width: 500px) {
    .snippet-label {
        font-size: 14px;
        color: var(--text-color-secondary);
        font-weight: 500;
        text-transform: none;
        /* Look like normal text? or keep uppercase? User example "Giá mua" is Sentence case */
    }
}

.snippet-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.text-primary {
    color: var(--text-color);
    /* Adjust if you want specific color */
}

/* Reusing existing classes */
.result-percent {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 0;
}

@media (max-width: 500px) {

    .snippet-value,
    .result-percent {
        font-size: 14px;
    }
}

.result-label {
    /* Kept for consistency if used elsewhere, but overridden by snippet-label above in usage */
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Post Actions (Footer) */
.post-actions {
    border-top: 1px solid var(--border-color);
    display: flex;
    padding: 4px;
}

.action-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: none;
}

/* --- Reddit Style Voting --- */
.reddit-actions {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    border-top: 1px solid var(--border-color-light);
    background: var(--bg-card);
}

.vote-cluster {
    display: flex;
    align-items: center;
    background: var(--bg-background);
    border-radius: 20px;
    padding: 2px;
}

.vote-btn {
    background: none;
    border: none;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    color: var(--text-muted);
}

.vote-btn .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: 'FILL' 0;
}

.vote-btn.up:hover {
    background: rgba(255, 69, 0, 0.1);
    color: var(--color-danger);
}

.vote-btn.up.active {
    color: #ff4500;
}

.vote-btn.up.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

.vote-btn.down:hover {
    background: rgba(113, 147, 255, 0.1);
    color: #7193ff;
}

.vote-btn.down.active {
    color: #7193ff;
}

.vote-btn.down.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

.vote-score {
    font-size: 13px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--text-color);
}

.action-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}

html.dark-mode .action-pill {
    box-shadow: none;
}

.action-pill:hover {
    background: rgba(127, 127, 127, 0.1);
    transform: none;
    box-shadow: none;
}

html.dark-mode .action-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.action-pill .material-symbols-outlined {
    font-size: 20px;
}

.action-item-wrap .like-count,
.action-item-wrap .comment-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 10px 10px 4px;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Badge for Open/Closed in Snippet */
.snippet-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    width: fit-content;
}

.badge-open {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-closed {
    background: #eeeeee;
    color: #616161;
}

/* Grid Layout is removed as we use global layout */
.profile-layout-grid {
    display: block;
    margin-top: 20px;
}

/* Bot Portfolio Notice */
.bot-portfolio-notice {
    background: var(--bg-body);
    border: none;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: none;
    transition: all 0.3s ease;
}

html.dark-mode .bot-portfolio-notice {
    background: var(--bg-body);
    box-shadow: none;
}

.notice-icon {
    font-size: 40px;
    margin-bottom: 5px;
}

.notice-content h4 {
    margin: 0 0 10px;
    color: var(--primary-color);
    font-size: 20px;
}

.notice-content p {
    color: var(--text-color-light);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
}

.btn-redirect-history {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-body);
    color: var(--primary-color) !important;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-light);
    border: none;
}

html.dark-mode .btn-redirect-history {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

.btn-redirect-history:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
    color: var(--primary-color-hover) !important;
}

html.dark-mode .btn-redirect-history:hover {
    box-shadow: var(--shadow-light);
}

.btn-redirect-history:active {
    transform: translateY(-1px);
    box-shadow: none;
}

html.dark-mode .btn-redirect-history:active {
    box-shadow: none;
}

.btn-redirect-history:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
    background-color: var(--primary-color-hover);
}

.btn-redirect-history .material-symbols-outlined {
    font-size: 20px;
}

@media (max-width: 992px) {
    .profile-layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Sidebar Styles */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* Sticky the last component in profile sidebar */
.profile-sidebar>*:last-child {
    position: sticky;
    top: 80px;
    z-index: 10;
}



.profile-intro-card {
    background: var(--bg-body);
    border: none;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-light);
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark-mode .profile-intro-card {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

.profile-intro-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
}

html.dark-mode .profile-intro-card:hover {
    box-shadow: var(--shadow-light);
}

.profile-intro-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    color: var(--text-color);
    font-weight: 800;
}

.intro-group {
    margin-bottom: 20px;
}

.intro-group:last-child {
    margin-bottom: 0;
}

.intro-group strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-color);
    font-weight: 700;
}

.intro-group p,
.intro-group div {
    color: var(--text-color-secondary);
    font-size: 15px;
    line-height: 1.5;
}

/* Portfolio List Styles */
.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.portfolio-item-card {
    background: var(--bg-body);
    border: none;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark-mode .portfolio-item-card {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

.portfolio-item-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
}

html.dark-mode .portfolio-item-card:hover {
    box-shadow: var(--shadow-light);
}

.p-card-left .p-symbol {
    font-weight: 800;
    font-size: 20px;
    color: var(--primary-color);
}

.p-card-left .p-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.p-card-right {
    text-align: right;
}

.p-price-row {
    font-size: 15px;
    margin-bottom: 6px;
}

.p-price-row:last-child {
    margin-bottom: 0;
}

.p-price-row span {
    color: var(--text-muted);
    margin-right: 10px;
}

.p-price-row strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Mobile Portfolio List (Neumorphism) */
.mobile-list {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .mobile-list.show-on-mobile {
        display: flex !important;
    }
}

.mobile-item {
    background: var(--bg-card) !important;
    border-radius: var(--card-radius);
    padding: 15px;
    border: 1px solid var(--border-color-light) !important;
    box-shadow: none !important;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}

html.dark-mode .mobile-item {
    background: var(--bg-card) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.mobile-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

html.dark-mode .mobile-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.mobile-item .m-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-item .m-sym {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
}

.mobile-item .m-val {
    font-weight: 700;
}

.mobile-item .m-val-small {
    font-weight: 600;
    color: var(--text-color);
}

.mobile-item .text-muted {
    font-size: 13px;
    color: var(--text-muted) !important;
}

/* Empty State */
.empty-state-card {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-body);
    border: none;
    border-radius: var(--card-radius);
    color: var(--text-muted);
    box-shadow: var(--shadow-inset);
}

html.dark-mode .empty-state-card {
    background: var(--bg-body);
    box-shadow: var(--shadow-inset);
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

/* --- Merged Profile / Edit Forms styles --- */
.profile-merged-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .profile-merged-grid {
        grid-template-columns: 1fr;
    }
}

.form-container-flat {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    padding: 30px;
}

html.dark-mode .form-container-flat {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-group-flat {
    margin-bottom: 15px;
}

.form-group-flat label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.input-flat {
    width: 100%;
    padding: 0 18px;
    border: 1px solid var(--border-color-input);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-color);
    font-size: 15px;
    height: var(--input-height);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

html.dark-mode .input-flat {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-flat:focus {
    border-color: var(--primary-color);
    outline: none;
}

html.dark-mode .input-flat:focus {
    border-color: var(--primary-color);
}

.form-row-flat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-flat {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: filter 0.2s;
    text-decoration: none;
    /* Ensure links don't have underline */
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-wide {
    width: 100%;
}

.btn-disabled {
    background: var(--bg-background);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

/* --- Flat Button Refinements (No Neumorphism) --- */
.btn-primary,
.btn-flat.btn-primary,
.btn-modal.btn-save,
.btn-success {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    font-weight: 700 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html.dark-mode .btn-primary,
html.dark-mode .btn-flat.btn-primary,
html.dark-mode .btn-modal.btn-save,
html.dark-mode .btn-success {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.btn-primary:hover,
.btn-flat.btn-primary:hover,
.btn-modal.btn-save:hover,
.btn-success:hover {
    transform: translateY(-2px) !important;
    background: var(--primary-color-hover) !important;
    box-shadow: 0 6px 15px rgba(0, 166, 81, 0.2) !important;
    /* Xanh lá nhấc bổng phẳng nhẹ */
}

html.dark-mode .btn-primary:hover,
html.dark-mode .btn-flat.btn-primary:hover,
html.dark-mode .btn-modal.btn-save:hover,
html.dark-mode .btn-success:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Secondary/Cancel Buttons */
.btn-secondary,
.btn-flat.btn-secondary,
.btn-modal.btn-cancel {
    background: var(--bg-hover) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color-light) !important;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

html.dark-mode .btn-secondary,
html.dark-mode .btn-flat.btn-secondary,
html.dark-mode .btn-modal.btn-cancel {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.btn-secondary:hover,
.btn-flat.btn-secondary:hover,
.btn-modal.btn-cancel:hover {
    transform: translateY(-2px) !important;
    background: var(--border-color-light) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05) !important;
}

html.dark-mode .btn-secondary:hover,
html.dark-mode .btn-flat.btn-secondary:hover,
html.dark-mode .btn-modal.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Primary Circle Buttons (Add Journal/Transaction) */
.btn-icon-circle.primary {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

html.dark-mode .btn-icon-circle.primary {
    background: var(--primary-color) !important;
    box-shadow: none !important;
}

.btn-icon-circle.primary:hover {
    transform: translateY(-2px) !important;
    background: var(--primary-color-hover) !important;
    box-shadow: 0 6px 15px rgba(0, 166, 81, 0.2) !important;
}

html.dark-mode .btn-icon-circle.primary:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
}

/* --- Service Packages Styles --- */
.packages-grid-flat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 650px) {
    .packages-grid-flat {
        grid-template-columns: 1fr;
    }
}

.package-flat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    padding: 35px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

html.dark-mode .package-flat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.package-flat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

html.dark-mode .package-flat-card:hover {
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.package-flat-card.premium {
    border: 1px solid #FFD700;
    background: linear-gradient(to bottom right, var(--bg-card), rgba(255, 215, 0, 0.05));
    position: relative;
    overflow: hidden;
}

.package-flat-card.premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #FFD700;
}

.pkg-header h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    color: var(--text-color);
}

.pkg-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.pkg-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    flex: 1;
}

.pkg-features li {
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-color);
    padding-left: 28px;
    position: relative;
}

.pkg-features li.check::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
}

.pkg-features li.uncheck {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.alert {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--color-success);
}

.alert-danger {
    background: #ffebee;
    color: var(--color-danger);
}

/* Share Button */
.share-profile-btn {
    margin-left: auto;
    /* Push to right in flex container */
    background: var(--bg-background);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.2s;
}

.share-profile-btn:hover {
    background: var(--border-color);
}

/* --- Edit Intro Button & Modal --- */
.edit-intro-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-intro-btn:hover {
    background: var(--bg-background);
    color: var(--primary-color);
}

/* Simple Modal Overlay */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(1.5px);
    /* Minimal blur for depth */
}

.custom-modal-overlay.open {
    display: flex;
    opacity: 1;
}

.custom-modal {
    background: var(--bg-body);
    width: 90%;
    max-width: 500px;
    border-radius: var(--card-radius);
    padding: 30px;
    transform: translateY(20px);
    transition: transform 0.3s;
    position: relative;
    border: none;
}

html.dark-mode .custom-modal {
    background: var(--bg-body);
    box-shadow: var(--shadow-light);
}

/* Fix double margin in Journal Modals */
.modal-body-custom .form-group-flat {
    margin-bottom: 15px;
}

.modal-body-custom div[style*="margin-bottom"]>.form-group-flat {
    margin-bottom: 0;
}

.custom-modal-overlay.open .custom-modal {
    transform: translateY(0);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.custom-modal-body .form-group-flat {
    margin-bottom: 15px;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.custom-modal-footer .btn-flat {
    min-width: 100px;
    /* Ensure reasonable size */
    font-size: 14px;
    /* Ensure same font size */
    padding: 10px 18px;
    /* Slightly compact */
    display: flex;
    /* Ensure center */
    align-items: center;
    /* Vertical center */
    justify-content: center;
    /* Horizontal center */
    height: 40px;
    /* Fixed height for consistency */
}

/* Secondary Button (Cancel) */
.btn-secondary {
    background: var(--bg-background);
    border: 1px solid var(--border-color);
    color: var(--text-color-secondary);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 0;
    margin-bottom: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    width: fit-content;
}

.social-link-item:hover {
    text-decoration: underline;
    filter: brightness(1.1);
}

.comments-section {
    display: none;
    padding: 15px;
    background: transparent;
    /* Đồng nhất với nền trắng của bài viết */
    border-top: 1px solid var(--border-color-light);
}

.comments-section.show {
    display: block !important;
}

.comments-list {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
    position: relative;
}

.comment-avatar {
    width: var(--avatar-size-sm);
    height: var(--avatar-size-sm);
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
}

.user-com-avatar {
    width: var(--avatar-size-sm);
    height: var(--avatar-size-sm);
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
}

.comment-bubble {
    background: var(--bg-hover);
    border: 1px solid var(--border-color-light);
    padding: 10px 16px;
    border-radius: 14px;
    display: inline-block;
    max-width: calc(100% - 45px);
    min-width: 80px;
    position: relative;
}

html.dark-mode .comment-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.replies-list {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-top: -2px;
    padding-top: 4px;
    transition: border-color 0.3s;
}

html.dark-mode .replies-list {
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.replies-list:hover {
    border-left-color: var(--primary-color);
}

.comment-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.comment-author a {
    color: inherit !important;
    text-decoration: none !important;
}

.btn-text-tiny {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.btn-text-tiny:hover {
    color: var(--primary-color);
}

.comment-text {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
    word-break: break-word;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color-input);
    border-radius: 30px;
    padding: 5px 15px;
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.comment-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    font-size: 14px;
    color: var(--text-color);
    outline: none !important;
    box-shadow: none !important;
}

.input-wrapper input.comment-input:focus,
.input-wrapper input.comment-input:active,
.input-wrapper input.comment-input {
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.send-comment-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.action-btn.active {
    color: var(--primary-color);
}

.action-btn.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* --- Follow Button --- */
.follow-post-btn,
.post-follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-background);
    /* Light gray optimized for dark/light */
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color);
    padding: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.follow-post-btn:hover,
.post-follow-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.follow-post-btn:active,
.post-follow-btn:active {
    transform: scale(0.95);
}

.follow-post-btn.followed,
.post-follow-btn.followed {
    background: none !important;
    border: 1px solid var(--border-color);
    color: var(--text-muted) !important;
}

.follow-post-btn .material-symbols-outlined,
.post-follow-btn .material-symbols-outlined {
    font-size: 20px;
}

/* --- Journal Tab Overrides --- */
.journal-card {
    background: var(--bg-body) !important;
    border: none !important;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: var(--app-gap) !important;
}

/* Force children to inherit parent background to fix color sync issues */
.journal-card .card-header-summary,
.journal-card .card-body-details {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
}

.journal-card.commentary-card {
    padding: 20px !important;
}

html.dark-mode .journal-card {
    box-shadow: var(--shadow-light);
}

/* Inset area for stats */
.stats-inset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    padding: 15px;
    background: var(--bg-body);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-inset);
    margin-top: 15px;
}

html.dark-mode .stats-inset-grid {
    box-shadow: var(--shadow-inset);
}

.stats-inset-grid>div {
    background: transparent !important;
    /* Remove individual backgrounds */
}

.journal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
}

html.dark-mode .journal-card:hover {
    box-shadow: var(--shadow-light);
}

/* Remove Journal Dots & Lines */
.journal-card::before,
.timeline-feed::before,
.journal-timeline-view::before {
    display: none !important;
}

.journal-timeline-view {
    padding-left: 0 !important;
}

/* Journal Card Header - Responsive Layout */
.card-header-summary {
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.journal-header-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.journal-symbol {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 50px;
}

.journal-desc {
    font-size: 14px;
    color: var(--text-color);
}

.journal-date {
    font-size: 12px;
    color: var(--text-muted);
}

.journal-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .card-header-summary {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
    }

    .journal-header-main {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .journal-header-meta {
        width: 100%;
        justify-content: space-between;
        margin-top: 5px;
    }

    .journal-symbol {
        min-width: auto;
    }
}

/* --- STANDARDIZED LAYOUT COMPONENTS --- */
.load-more-container {
    text-align: center;
    margin-top: calc(var(--app-gap) * 2);
}

.btn-primary-neumorph {
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.btn-primary-neumorph:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* --- STANDARDIZED WIDTH FOR ALL JOURNAL VIEWS --- */
.view-switcher-full-width,
.journal-controls-row,
.journal-timeline-view,
.calendar-grid-container,
.calendar-controls,
#calendar-date-details {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.journal-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--app-gap);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color-light);
    gap: 15px;
    flex-wrap: wrap;
}

.search-filter {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
    /* Allow it to shrink if needed */
    align-items: center;
}

.journal-actions-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.journal-expand-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px !important;
    background: var(--bg-hover);
    border: none !important;
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    height: var(--btn-height) !important;
    font-size: 13px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.journal-expand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
    background: var(--border-color-light);
}

.journal-expand-label {
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .journal-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-filter {
        width: 100%;
        flex-wrap: nowrap;
        /* Prevent wrapping to keep items on one line */
        min-width: 0;
        gap: 6px;
        /* Slightly tighter gap to fit 3 items */
    }

    .journal-filter-item {
        flex: 1 1 auto !important;
        /* Allow items to share space naturally */
        min-width: 0 !important;
        padding: 0 8px !important;
        /* Reduced padding to save horizontal space */
        font-size: 12px !important;
        /* Slightly smaller font to ensure text fits */
    }

    input.journal-filter-item {
        flex: 1.4 1 0% !important;
        /* Search bar gets a bit more space but still shares */
    }

    select.journal-filter-item {
        flex: 1 1 0% !important;
        padding-right: 20px !important;
        /* Slightly smaller space for arrow */
    }

    .journal-actions-group {
        justify-content: space-between;
        margin-top: 5px;
        flex-wrap: wrap;
    }
}

/* --- PERFORMANCE TAB STYLES --- */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--app-gap);
    margin-top: var(--app-gap);
}

.performance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: var(--card-radius);
    padding: 30px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

html.dark-mode .performance-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.performance-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.performance-card h3 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 25px;
    padding-bottom: 0;
    border: none;
    font-weight: 800;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-neumorphic-base {
    width: 220px;
    height: 220px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.perf-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: 50px 0;
}

/* --- BUTTON & INPUT REFINEMENTS --- */
.view-switcher-pill {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color-light) !important;
    box-shadow: none !important;
    padding: 4px !important;
    height: var(--btn-height) !important;
    border-radius: 12px !important;
    display: flex;
    align-items: stretch;
    width: 100%;
    transition: border-color 0.2s ease !important;
}

.switcher-btn {
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.switcher-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: none !important;
}

.journal-filter-item {
    border: none !important;
    background-color: var(--bg-input) !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
    border-radius: 12px !important;
    outline: none !important;
    color: var(--text-color) !important;
    padding: 0 15px !important;
    font-size: 13px !important;
    height: var(--input-height) !important;
}

.journal-filter-item:focus {
    background-color: var(--bg-hover) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Specific widths for inputs vs selects */
input.journal-filter-item {
    min-width: 80px !important;
    max-width: 180px;
    flex: 1 !important;
}

select.journal-filter-item {
    min-width: 100px !important;
    max-width: 140px;
    padding-right: 25px !important;
    /* Space for arrow */
}

.journal-owner-icon-actions {
    display: flex;
    gap: 10px;
}

.journal-owner-icon-actions .btn-icon-circle {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.performance-title {
    font-size: 18px;
    margin-bottom: var(--app-gap);
    color: var(--text-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    font-weight: 700;
}

.chart-legend {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
}

.chart-legend span {
    font-weight: bold;
}