/* Ehealth Tree CSS */
.ehealth-tree-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'IranYekan', Vazirmatn, Sahel, Tahoma, Arial, sans-serif;
}

.ehealth-tree-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #0a8f3c, #0d6efd);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(10, 143, 60, 0.3);
}

.ehealth-tree-header h1 {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.ehealth-tree-header p {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.9;
}

.ehealth-legend {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #0a8f3c;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ehealth-legend .dot {
    width: 16px;
    height: 16px;
    background: #0a8f3c;
    border-radius: 4px;
    display: inline-block;
}

.ehealth-tree {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.policy-level {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.policy-level:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.policy-header {
    background: linear-gradient(135deg, #495057, #6c757d);
    color: white;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.policy-header:hover {
    background: linear-gradient(135deg, #343a40, #495057);
}

.policy-header h2 {
    margin: 0;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.policy-header .policy-icon {
    font-size: 1.2em;
    opacity: 0.8;
}

.policy-header .expand-icon {
    font-size: 1.5em;
    transition: transform 0.3s ease;
}

.policy-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.strategies-container {
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.strategies-container.expanded,
.strategies-container[style*="display: block"] {
    display: block !important;
}

.strategy-level {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s ease;
}

.strategy-level:last-child {
    border-bottom: none;
}

.strategy-level:hover {
    background: #f8f9fa;
}

.strategy-header {
    background: #f1f3f4;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.strategy-header:hover {
    background: #e9ecef;
}

.strategy-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strategy-header .strategy-icon {
    font-size: 1em;
    color: #6c757d;
}

.strategy-header .expand-icon {
    font-size: 1.2em;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.strategy-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.programs-container {
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.programs-container.expanded,
.programs-container[style*="display: block"] {
    display: block !important;
}

.programs-list {
    padding: 20px;
    background: white;
}

.program-item {
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.program-item:hover {
    background: #f8f9fa;
    border-left-color: #0a8f3c;
    transform: translateX(5px);
}

.program-item.ehealth {
    border-left-color: #0a8f3c;
    background: linear-gradient(135deg, #f0f9f0, #e8f5e8);
}

.program-item.ehealth:hover {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    box-shadow: 0 2px 8px rgba(10, 143, 60, 0.2);
}

.program-number {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.program-item.ehealth .program-number {
    background: #0a8f3c;
}

.program-text {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.5;
    color: #495057;
}

.program-item.ehealth .program-text {
    color: #0a8f3c;
    font-weight: 500;
}

.ehealth-badge {
    background: #0a8f3c;
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.65em;
    font-weight: bold;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
    margin-left: auto;
}

.program-title {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.5;
    color: #495057;
}

.program-item.ehealth .program-title {
    color: #0a8f3c;
    font-weight: 500;
}

/* Program Link Styles */
.program-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    flex: 1;
    transition: all 0.3s ease;
}

.program-link:hover {
    text-decoration: none;
    color: #0a8f3c;
}

.program-item.ehealth .program-link:hover {
    color: #087a35;
}

.program-link .program-title {
    cursor: pointer;
    transition: color 0.3s ease;
}

.program-link:hover .program-title {
    color: #0a8f3c;
}

.program-item.ehealth .program-link:hover .program-title {
    color: #087a35;
}

/* Link Indicator Styles */
.link-indicator {
    font-size: 0.8em;
    opacity: 0.6;
    margin-right: 8px;
    transition: opacity 0.3s ease;
}

.program-link:hover .link-indicator {
    opacity: 1;
}

.program-item.ehealth .link-indicator {
    color: #0a8f3c;
}

/* Program Details Not Defined Indicator Styles */
.no-goals-indicator {
    font-size: 0.7em;
    color: #dc3545;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 8px;
    margin-right: 8px;
    font-weight: 500;
}

.program-item.no-goals {
    opacity: 0.7;
    cursor: default;
}

.program-item.no-goals:hover {
    transform: none;
    background: #f8f9fa;
    border-left-color: #dee2e6;
}

.program-item.no-goals .program-title {
    color: #6c757d;
    cursor: default;
}

.program-item.no-goals.ehealth .program-title {
    color: #6c757d;
}

/* Search Result Link Styles */
.search-result-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.search-result-link:hover {
    text-decoration: none;
    color: #0a8f3c;
}

.search-results li.ehealth .search-result-link:hover {
    color: #087a35;
}

/* Search Result No Details Styles */
.search-results li.no-goals {
    opacity: 0.7;
}

.search-result-title {
    color: #6c757d;
    font-style: italic;
}

.search-results li.no-goals .no-goals-indicator {
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ehealth-tree-container {
        padding: 10px;
    }
    
    .ehealth-tree-header h1 {
        font-size: 2em;
    }
    
    .policy-header h2 {
        font-size: 1.2em;
    }
    
    .strategy-header h3 {
        font-size: 1.1em;
    }
    
    .program-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .program-number {
        align-self: flex-start;
    }
}

/* Animation for expanding/collapsing */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.strategies-container.expanded,
.programs-container.expanded {
    animation: slideDown 0.3s ease;
}

/* Search and filter styles */
.ehealth-search {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.expand-all,
.collapse-all {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.expand-all:hover,
.collapse-all:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.expand-all {
    background: #28a745;
}

.expand-all:hover {
    background: #218838;
}

.collapse-all {
    background: #dc3545;
}

.collapse-all:hover {
    background: #c82333;
}

.ehealth-search input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.ehealth-search input:focus {
    outline: none;
    border-color: #0a8f3c;
    box-shadow: 0 0 0 3px rgba(10, 143, 60, 0.1);
}

.ehealth-search button {
    padding: 12px 20px;
    background: #0a8f3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

.ehealth-search button:hover {
    background: #087a35;
}

/* Statistics display */
.ehealth-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #0a8f3c;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #0a8f3c;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
}

/* Search results styles */
.search-results {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-results h3 {
    color: #0a8f3c;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.search-results p {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.back-btn {
    background: #0a8f3c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #087a35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 143, 60, 0.3);
}

/* Print styles */
@media print {
    .ehealth-tree-container {
        padding: 0;
    }
    
    .ehealth-search,
    .ehealth-stats {
        display: none;
    }
    
    .policy-level {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
