/* ==========================================================================
   Directory Structure Page Specific Styles
   ========================================================================== */

/* Overview Stats */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.stat-content h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* Directory Tree Structure */
.directory-tree {
    background: #fafbfc;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 2px 0;
    position: relative;
    border-radius: 4px;
}

/* Tree Lines */
.tree-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 50%;
    width: 1px;
    background: #d0d7de;
    z-index: 1;
}

.tree-item::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: #d0d7de;
    z-index: 1;
}

/* Remove lines for root items */
.tree-item.root::before,
.tree-item.root::after {
    display: none;
}

/* Last child in a group */
.tree-item.last-child::before {
    height: 50%;
}

/* Nested items */
.tree-item.level-1 {
    padding-left: 20px;
}

.tree-item.level-2 {
    padding-left: 40px;
}

.tree-item.level-2::before {
    left: 28px;
}

.tree-item.level-2::after {
    left: 28px;
}

.tree-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
}

.tree-icon.folder {
    color: #f39c12;
}

.tree-icon.folder-open {
    color: #f39c12;
}

.tree-icon.file {
    color: #6c757d;
}

.tree-icon.vue-file {
    color: #4fc08d;
}

.tree-icon.js-file {
    color: #f7df1e;
}

.tree-icon.config-file {
    color: #007acc;
}

.tree-icon.html-file {
    color: #e34c26;
}

.tree-name {
    font-weight: 500;
    color: #24292f;
    margin-right: 12px;
    z-index: 2;
    position: relative;
}

.tree-item.folder .tree-name {
    font-weight: 600;
}

.tree-desc {
    color: #656d76;
    font-size: 0.85em;
    font-style: italic;
    margin-left: auto;
    font-weight: 400;
}

/* File sizes */
.file-size {
    color: #8b949e;
    font-size: 0.75em;
    margin-left: 8px;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
    .directory-tree {
        font-size: 12px;
        padding: 1rem;
    }
    
    .tree-desc {
        display: none;
    }
    
    .tree-item.level-1 {
        padding-left: 16px;
    }
    
    .tree-item.level-2 {
        padding-left: 32px;
    }
}

/* Directory Detail Sections */
.directory-detail {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.directory-detail h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.usage-example {
    background: var(--grey100);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.usage-example h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.usage-example ul {
    margin: 0;
    padding-left: 1.5rem;
}

.usage-example li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Configuration Cards */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.config-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.config-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.config-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.config-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.config-card h5 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.config-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.config-type {
    background: var(--lightprimary);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-block;
}

/* Convention Grid */
.convention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.convention-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.convention-item h6 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.convention-item p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.code-example {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-example code {
    background: var(--grey100);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    border-left: 3px solid var(--primary-color);
}

/* Best Practices */
.best-practices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.practice-item {
    display: flex;
    gap: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.practice-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.practice-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.practice-icon.success {
    background: var(--lightsuccess);
    color: var(--success-color);
}

.practice-icon.warning {
    background: var(--lightwarning);
    color: var(--warning-color);
}

.practice-content h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.practice-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

/* Structure Section */
.structure-section {
    margin-bottom: 4rem;
}

.structure-section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.structure-section h2 i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .overview-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-content h4 {
        font-size: 1.5rem;
    }
    
    .directory-tree {
        padding: 1.5rem;
        font-size: 0.875rem;
    }
    
    .tree-children {
        margin-left: 1.5rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .convention-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .practice-item {
        flex-direction: column;
        text-align: center;
    }
    
    .practice-icon {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .directory-detail {
        padding: 1.5rem;
    }
    
    .config-card {
        padding: 1.5rem;
    }
    
    .convention-item {
        padding: 1.5rem;
    }
}
