/* ===== CSS Reset & Variables ===== */
:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --male-node: #f8fafc;
    --female-node: #334155;
    --male-text: #0f172a;
    --female-text: #f8fafc;
    --line-color: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Typography ===== */
h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ===== Header ===== */
.site-header {
    background: rgba(15, 23, 42, 0.95); /* Semi-solid theme background */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 9999; /* Displayed all the time above all */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container h1 {
    margin: 0;
    font-size: 1.5rem;
    background: -webkit-linear-gradient(45deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-nav a, .main-nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ===== Main Area ===== */
.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tree-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: calc(100vh - 140px); /* header + footer approx */
}

/* Tree Controls */
.tree-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.tree-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tree-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* ===== D3 Tree SVG Styles ===== */
.node circle {
    stroke: var(--primary-color);
    stroke-width: 3px;
    transition: all 0.3s ease;
}

.node.male circle {
    fill: var(--male-node);
}

.node.female circle {
    fill: var(--female-node);
}

.node text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.node.male text {
    fill: var(--male-text);
}

.node.female text {
    fill: var(--female-text);
}

.node:hover circle {
    stroke-width: 5px;
    filter: drop-shadow(0 0 8px var(--primary-color));
}

.link {
    fill: none;
    stroke: var(--line-color);
    stroke-width: 2px;
}

/* ===== Footer ===== */
.site-footer {
    background: rgba(15, 23, 42, 0.96) !important; /* Matches main bg */
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 0 !important;
    text-align: center;
    font-size: 0.9rem;
    color: #94a3b8;
    position: fixed; /* Sticky fixed to viewport bottom */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999; /* Displayed all the time above all */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.site-footer p {
    margin-bottom: 0.5rem;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #1e293b;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-effect {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
}

.close-modal {
    color: #94a3b8;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: #fff;
    text-decoration: none;
}

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

/* ===== Admin Forms & Tables ===== */
.admin-container {
    padding: 2rem 0;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #cbd5e1;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.table th {
    font-weight: 600;
    color: #94a3b8;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }

/* ===== Premium Drawer & Visual Upgrades ===== */
.detail-drawer {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: 380px;
    max-width: calc(100% - 40px);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(420px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-drawer.show {
    transform: translateX(0);
}

.close-drawer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-drawer:hover {
    color: #fff;
}

.drawer-header {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.drawer-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.drawer-avatar.female {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
}

.drawer-avatar.virtual {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.drawer-badge-container {
    margin-top: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.male {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.female {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge.virtual {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
}

.drawer-info-group {
    margin-bottom: 1.25rem;
}

.drawer-info-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.drawer-info-group .info-val {
    font-size: 1rem;
    font-weight: 500;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Beautiful custom node icons & styles */
.node circle {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link {
    stroke-linecap: round;
    transition: stroke-width 0.3s;
}

.link:hover {
    stroke-width: 4px;
    stroke: #3b82f6 !important;
}

/* Glassmorphic Cards & Elevating inputs */
.glass-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.form-control {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.6);
}

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    color: #e2e8f0;
    vertical-align: middle;
}

/* ===== Floating Search Bar (Premium Glassmorphism) ===== */
.search-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 1rem;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 8px 24px -4px rgba(0, 0, 0, 0.4);
    background: rgba(15, 23, 42, 0.85);
}

.search-icon {
    color: #94a3b8;
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: color 0.3s;
}

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

.search-input {
    width: 100%;
    height: 48px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-input::placeholder {
    color: #64748b;
}

.search-results {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    display: none;
}

.search-results.show {
    display: block;
    animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
}

.search-item-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.search-item-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.search-item-badge.M {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.search-item-badge.F {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive & Mobile Friendly Overrides ===== */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .header-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0;
    }
    
    .header-container h1 {
        font-size: 1.1rem !important;
        margin: 0;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
    }
    
    .header-icon {
        height: 24px !important;
        width: 24px !important;
    }
    
    .main-nav {
        margin-top: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .main-nav .btn {
        padding: 0.35rem 0.8rem !important;
        font-size: 0.8rem !important;
        margin-left: 0 !important;
        white-space: nowrap !important;
    }
    
    .admin-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 0.25rem 0.5rem !important;
        margin-top: 0 !important;
    }
    
    .admin-nav a {
        margin-left: 0;
        font-size: 0.8rem !important;
    }
    
    /* Center search bar and give it more breathing room on mobile */
    .search-container {
        width: calc(100% - 40px) !important;
        left: 20px !important;
        top: 15px !important;
    }
    
    /* Make controls look clean and floating on mobile */
    .tree-controls {
        top: 75px;
        right: 20px;
    }
    
    .tree-container {
        min-height: calc(100vh - 180px);
    }
    
    /* Glass cards and lists optimization for narrow mobile devices */
    .admin-container {
        padding: 1rem 0;
    }
    
    .glass-card {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    /* Scale down font sizes on tables */
    .table th, .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.4rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header-container h1 {
        font-size: 0.95rem !important;
        gap: 0.35rem !important;
    }
    
    .header-icon {
        height: 20px !important;
        width: 20px !important;
    }
    
    .main-nav .btn {
        padding: 0.25rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    
    .admin-nav {
        gap: 0.2rem 0.4rem !important;
    }
    
    .admin-nav a {
        font-size: 0.75rem !important;
    }
    
    .search-container {
        width: calc(100% - 20px) !important;
        left: 10px !important;
        top: 10px !important;
    }
    
    .tree-controls {
        top: 70px;
        right: 10px;
    }
}

/* ===== Family Diary Styles (White Cards, Theme Borders, Black Fonts) ===== */
.diary-container {
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 20px 100px; /* Increased bottom padding to prevent content from being covered by fixed footer */
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: calc(100vh - 140px);
    box-sizing: border-box;
    align-items: center; /* Center all elements inside the container */
}

/* Sticky top search header matching theme - beautiful pill search bar */
.diary-search-container {
    position: sticky;
    top: 70px;
    z-index: 90;
    width: 100%;
    margin-bottom: 5px;
}

.diary-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1.5px solid color-mix(in srgb, var(--primary-color) 25%, rgba(255, 255, 255, 0.15));
    border-radius: 999px; /* Modern Pill shape */
    padding: 0 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.diary-search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary-color) 35%, transparent), 0 8px 30px rgba(0, 0, 0, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.diary-search-icon {
    color: var(--primary-color); /* Theme color icon by default */
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.diary-search-wrapper:focus-within .diary-search-icon {
    transform: scale(1.15);
}

.diary-search-input {
    width: 100%;
    height: 48px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

/* Real-time search results dropdown matching the theme */
.diary-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    border: 1.5px solid color-mix(in srgb, var(--primary-color) 25%, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
}

.diary-search-results.show {
    display: block;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.diary-search-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.diary-search-item:last-child {
    border-bottom: none;
}

.diary-search-item:hover {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
}

.diary-search-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
}

.diary-search-item-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Sort selector styling matching site theme & centered */
.diary-sort-wrapper {
    display: flex;
    align-items: center;
    justify-content: center; /* Horizontally center sort buttons */
    gap: 12px;
    width: 100%;
    margin-bottom: 5px;
    padding: 0 4px;
    box-sizing: border-box;
}

.diary-sort-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.diary-sort-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.diary-sort-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.35rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diary-sort-btn:hover {
    border-color: var(--primary-color);
    color: #ffffff;
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
}

.diary-sort-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

/* Scrollable vertical list container */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

/* White business cards with theme borders and pure black fonts */
.diary-card {
    background: #ffffff;
    border: 2.5px solid var(--primary-color); /* Theme colored border */
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    scroll-margin-top: 150px;
    width: 100%;
    align-items: center; /* Center everything inside the card vertically line-by-line */
}

.diary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 0 20px color-mix(in srgb, var(--primary-color) 15%, transparent);
}

/* Inside white card, details styled vertically line-by-line with black fonts */
.diary-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000; /* Pure black */
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    text-align: center;
}

.diary-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #000000; /* Pure black font */
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-all;
    font-weight: 600; /* Medium-bold for crisp readability */
    line-height: 1.4;
    text-align: center;
}

a.diary-info-item:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.diary-info-icon {
    flex-shrink: 0;
    color: var(--primary-color); /* Theme colored icons */
}

/* Pulse Highlight Focus Effect */
.pulse-highlight {
    animation: diaryCardPulse 1.6s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes diaryCardPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.8);
        transform: scale(1.02);
        border-color: var(--primary-color);
    }
    40% {
        box-shadow: 0 0 25px 8px rgba(59, 130, 246, 0.5);
        transform: scale(1.025);
        border-color: var(--primary-color);
    }
    100% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
        transform: scale(1);
        border-color: var(--primary-color);
    }
}

/* Empty State */
.diary-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.02);
    width: 100%;
    box-sizing: border-box;
}

/* Responsive Overrides */
@media (max-width: 550px) {
    .diary-container {
        padding: 50px 15px 30px;
        gap: 16px;
    }
    
    .diary-search-container {
        top: 60px;
    }
    
    .diary-card {
        padding: 1.25rem;
        gap: 8px;
        border-radius: 12px;
    }
    
    .diary-name {
        font-size: 1.15rem;
    }
    
    .diary-info-item {
        font-size: 0.85rem;
    }
    
    .diary-sort-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .diary-sort-options {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }
    
    .diary-sort-btn {
        flex: 1;
        padding: 0.35rem 0;
        text-align: center;
        font-size: 0.75rem;
        min-width: 65px;
    }
}





