/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    height: 100vh;
    height: 100dvh; /* Modern viewport height for mobile */
    min-height: -webkit-fill-available; /* WebKit mobile fix */
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #f0f0f0;
    min-height: 100vh;
    min-height: 100dvh; /* Mobile viewport fix */
    min-height: -webkit-fill-available; /* WebKit fallback */
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    color: #daa520;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    color: #c0c0c0;
    font-style: italic;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.last-updated {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* PRIMARY TOOLBAR STYLES - Enhanced for Mobile */
.primary-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 12px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Mobile fixes */
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-align-items: center;
    min-height: 44px; /* iOS standard toolbar height */
    position: relative;
    z-index: 1000;
}

/* Mobile Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .primary-toolbar {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
    }
}

/* Chrome mobile specific */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .primary-toolbar {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

.primary-tabs {
    display: flex;
    gap: 8px;
}

.primary-tab {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 12px;
    color: #c0c0c0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-tab.active {
    background: rgba(218, 165, 32, 0.2);
    border-color: #daa520;
    color: #daa520;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.3);
    transform: translateY(-1px);
}

.primary-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(218, 165, 32, 0.5);
    color: #e0e0e0;
    transform: translateY(-1px);
}

/* ADMIN ACCESS BUTTON */
.admin-access {
    display: flex;
    align-items: center;
}

.admin-toggle-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    font-size: 14px;
}

.admin-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff5252, #ff7979);
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 30px;
    align-items: start;
}

/* Tree of Life - Enhanced for Mobile */

/* Enhanced Tree Container with Sacred Atmosphere */
.tree-container {
    position: relative;
    background: 
        radial-gradient(circle at 30% 20%, rgba(218, 165, 32, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(74, 144, 226, 0.05) 0%, transparent 50%),
        rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tree-of-life {
    position: relative;
    width: 100%;
    height: 800px;
    margin: 0 auto;
}

/* Enhanced Sefirah Styles */
.sefirah {
    position: absolute;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 3px solid #daa520;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.4),
        0 0 20px rgba(218, 165, 32, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    overflow: visible;
    line-height: 1.1;
}

/* Hebrew letters inside the orb */
.sefirah::before {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 2px;
    opacity: 0.9;
}

/* Aura Effect */
.sefirah::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 60%, rgba(218, 165, 32, 0.1) 80%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.sefirah:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(218, 165, 32, 0.5);
    border-color: #fff;
}

.sefirah:hover::after {
    opacity: 1;
}

.sefirah.active {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
    transform: scale(1.15);
}

/* Individual sefirot with Hebrew letters inside */
.keter { 
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #000 0%, #333 100%); 
    color: white; 
}
.keter::before { content: 'כתר'; }

.hochma { 
    top: 120px; 
    right: 25%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%); 
    color: white; 
}
.hochma::before { content: 'חכמה'; }

.binah { 
    top: 120px; 
    left: 25%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #008000 0%, #065f46 100%); 
    color: white; 
}
.binah::before { content: 'בינה'; }

.daath { 
    top: 180px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #800080 0%, #581c87 100%); 
    color: white; 
    opacity: 0.8;
    font-style: italic;
}
.daath::before { content: 'דעת'; }

.hesed { 
    top: 250px; 
    right: 15%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #c0c0c0 0%, #9ca3af 100%); 
    color: #1a1a1a; 
}
.hesed::before { content: 'חסד'; color: #666; }

.gevurah { 
    top: 250px; 
    left: 15%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #dc143c 0%, #991b1b 100%); 
    color: white; 
}
.gevurah::before { content: 'גבורה'; }

.tiferet { 
    top: 320px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #ffd700 0%, #eab308 100%); 
    color: #1a1a1a; 
}
.tiferet::before { content: 'תפארת'; color: #8b6914; }

.netsach { 
    top: 450px; 
    right: 20%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #ffc0cb 0%, #f9a8d4 100%); 
    color: #1a1a1a; 
}
.netsach::before { content: 'נצח'; color: #8b5a6b; }

.hod { 
    top: 450px; 
    left: 20%; 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #ff69b4 0%, #ec4899 100%); 
    color: white; 
}
.hod::before { content: 'הוד'; }

.yesod { 
    top: 540px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #ffa500 0%, #ea580c 100%); 
    color: #1a1a1a; 
}
.yesod::before { content: 'יסוד'; color: #cc6600; }

.malchut { 
    top: 680px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #4169e1 0%, #1e40af 100%); 
    color: white; 
}
.malchut::before { content: 'מלכות'; }

/* Subtle connecting lines always visible */
.tree-of-life::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Central Pillar */
        linear-gradient(0deg, transparent 0%, transparent 45%, rgba(218, 165, 32, 0.1) 50%, transparent 55%, transparent 100%),
        /* Diagonal connections - simplified */
        radial-gradient(ellipse 2px 200px at 40% 30%, rgba(218, 165, 32, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 2px 200px at 60% 30%, rgba(218, 165, 32, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Info Panel */
.info-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 800px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* SECONDARY TOOLBAR STYLES */
.secondary-toolbar {
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.secondary-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.secondary-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.secondary-tab.active {
    background: rgba(218, 165, 32, 0.15);
    border-color: rgba(218, 165, 32, 0.4);
    color: #daa520;
    box-shadow: 0 2px 6px rgba(218, 165, 32, 0.2);
}

.secondary-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
    color: #c0c0c0;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Legacy Tab Styles (for backward compatibility) */
.tabs {
    display: none; /* Hide the old tabs container */
}

.tab {
    /* Keep existing tab styles for modules that might still reference them */
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Search Styles */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Content Areas */
.default-info {
    text-align: center;
    color: #c0c0c0;
    font-style: italic;
    margin-top: 50px;
    padding: 30px;
}

.default-info h3 {
    color: #daa520;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Search Results */
.search-results {
    margin-top: 20px;
}

.search-result {
    background: rgba(218, 165, 32, 0.1);
    border-left: 4px solid #daa520;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result:hover {
    background: rgba(218, 165, 32, 0.2);
    transform: translateX(5px);
}

.search-result strong {
    color: #daa520;
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}

/* Citations Container */
.citations-container {
    padding: 10px 0;
}

.citations-container h3 {
    color: #daa520;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid #daa520;
    padding-bottom: 10px;
}

/* ADMIN PANEL OVERLAY */
.admin-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.admin-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: adminPanelSlideIn 0.3s ease;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.1);
    border-radius: 18px 18px 0 0;
}

.admin-panel-header h3 {
    color: #ff6b6b;
    margin: 0;
    font-size: 1.4em;
}

.admin-close-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-close-btn:hover {
    background: #ff5252;
    transform: rotate(90deg);
}

.admin-panel-content {
    padding: 25px;
}

@keyframes adminPanelSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Floating Help Button */
.floating-help-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(218, 165, 32, 0.9);
    color: #000;
    border: 2px solid #daa520;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.floating-help-btn:hover {
    background: #daa520;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(218, 165, 32, 0.4);
}

.floating-help-btn:active {
    transform: scale(0.95);
}

/* About Button Styling */
.about-toggle-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    font-size: 14px;
    margin-right: 12px;
}

.about-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd, #2968a3);
}

/* About Panel Overlay */
.about-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4a90e2;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: aboutPanelSlideIn 0.3s ease;
}

.about-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    background: rgba(74, 144, 226, 0.1);
    border-radius: 18px 18px 0 0;
}

.about-panel-header h3 {
    color: #4a90e2;
    margin: 0;
    font-size: 1.4em;
}

.about-close-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-close-btn:hover {
    background: #357abd;
    transform: rotate(90deg);
}

.about-panel-content {
    padding: 25px;
    color: #e0e0e0;
}

/* About Content Sections */
.about-description {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid rgba(74, 144, 226, 0.2);
    padding-bottom: 20px;
}

.about-description h4 {
    color: #4a90e2;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.about-description p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #c0c0c0;
}

.about-organizations {
    margin-bottom: 30px;
}

.organization {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid #4a90e2;
}

.org-logo {
    flex-shrink: 0;
}

.logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1);
}

.org-info h5 {
    color: #4a90e2;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.org-info p {
    color: #c0c0c0;
    line-height: 1.5;
    margin-bottom: 10px;
}

.org-link {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.org-link:hover {
    color: #357abd;
    text-decoration: underline;
}

.about-credits {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(218, 165, 32, 0.1);
    border-radius: 12px;
    border-left: 4px solid #daa520;
}

.about-credits h5 {
    color: #daa520;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.about-credits p {
    color: #e0e0e0;
    line-height: 1.6;
}

.about-features {
    margin-top: 20px;
}

.about-features h5 {
    color: #4a90e2;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.about-features ul {
    list-style: none;
    padding-left: 0;
}

.about-features li {
    padding: 5px 0;
    color: #c0c0c0;
    position: relative;
    padding-left: 20px;
}

.about-features li:before {
    content: "✦";
    color: #4a90e2;
    position: absolute;
    left: 0;
    top: 5px;
}

.about-footer {
    text-align: center;
    border-top: 2px solid rgba(74, 144, 226, 0.2);
    padding-top: 20px;
    margin-top: 20px;
}

.about-footer p {
    color: #888;
    margin-bottom: 15px;
}

/* Books Section Styles */
.about-books {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(218, 165, 32, 0.08);
    border-radius: 12px;
    border-left: 4px solid #daa520;
}

.about-books h5 {
    color: #daa520;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.about-books > p {
    color: #c0c0c0;
    margin-bottom: 20px;
    line-height: 1.5;
}

.book {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.book:hover {
    background: rgba(255, 255, 255, 0.06);
}

.book:last-child {
    margin-bottom: 0;
}

.book-cover {
    flex-shrink: 0;
}

.book-img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.book-img:hover {
    transform: scale(1.05);
}

.book-info {
    flex: 1;
}

.book-info h6 {
    color: #daa520;
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 6px;
    line-height: 1.3;
}

.book-info p {
    color: #b0b0b0;
    font-size: 0.85em;
    line-height: 1.3;
    margin-bottom: 8px;
}

.book-link {
    color: #daa520;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.book-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Mobile responsive adjustments for books */
@media (max-width: 768px) {
    .book {
        gap: 10px;
    }
    
    .book-img {
        width: 35px;
        height: 50px;
    }
    
    .book-info h6 {
        font-size: 0.9em;
    }
    
    .book-info p {
        font-size: 0.8em;
    }
}

.help-link {
    display: inline-block;
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.help-link:hover {
    background: rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

@keyframes aboutPanelSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* RESPONSIVE DESIGN - Enhanced for Mobile Compatibility */

/* Modern Viewport Height Support */
@supports (height: 100dvh) {
    html, body {
        height: 100dvh;
        min-height: 100dvh;
    }
}

/* Mobile-specific fixes for toolbar rendering */
@media (max-width: 768px) {
    .primary-toolbar {
        height: 44px;
        padding: 0 12px;
        box-sizing: border-box;
        flex-direction: column;
        gap: 12px;
        min-height: auto;
        height: auto;
        padding: 15px;
    }
    
    .primary-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .primary-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .secondary-tabs {
        flex-wrap: wrap;
    }
}

/* Tablet and smaller desktop responsive design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tree-of-life {
        height: 500px;
    }
    
    .sefirah {
        width: 65px;
        height: 65px;
        font-size: 11px;
    }
    
    .info-panel {
        max-height: 600px;
    }
}

/* Mobile phones responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .tree-of-life {
        height: 400px;
    }
    
    .sefirah {
        width: 50px;
        height: 50px;
        font-size: 9px;
    }
    
    .admin-panel {
        width: 95%;
        margin: 20px;
    }
    
    .admin-panel-content {
        padding: 20px;
    }
    
    .floating-help-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
        top: 15px;
        right: 15px;
    }
    
    .about-panel {
        width: 95%;
        margin: 20px;
    }
    
    .about-panel-content {
        padding: 20px;
    }
    
    .organization {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo-img {
        width: 60px;
        height: 60px;
    }
    
    .about-toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
        margin-right: 8px;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .primary-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .secondary-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .admin-toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .floating-help-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 12px;
        right: 12px;
    }
    
    .about-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .about-description h4 {
        font-size: 1.3em;
    }
}

/* Feature Detection for Better Browser Support */

/* Flexbox support check */
@supports (display: flex) {
    .primary-toolbar {
        display: flex;
    }
    
    .secondary-tabs {
        display: flex;
    }
}

@supports not (display: flex) {
    .primary-toolbar {
        display: block;
        overflow: hidden;
    }
    
    .primary-tabs {
        float: left;
    }
    
    .admin-access {
        float: right;
    }
}

/* Grid support check */
@supports (display: grid) {
    .main-content {
        display: grid;
    }
}

@supports not (display: grid) {
    .main-content {
        display: block;
    }
    
    .tree-container {
        margin-bottom: 30px;
    }
}

/* Backdrop filter support */
@supports (backdrop-filter: blur(10px)) {
    .primary-toolbar,
    .tree-container,
    .info-panel,
    header {
        backdrop-filter: blur(10px);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    .primary-toolbar,
    .tree-container,
    .info-panel,
    header {
        background: rgba(255, 255, 255, 0.15);
    }
}