/* Mode Templates Styles */

#mode-templates-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    /* Custom scrollbar for webkit */
    scrollbar-width: thin;
    scrollbar-color: var(--primary, #667eea) transparent;
}

#mode-templates-wrapper::-webkit-scrollbar {
    width: 8px;
}

#mode-templates-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#mode-templates-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--primary, #667eea);
    border-radius: 4px;
}

.mode-templates {
    padding: 4rem 2rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.templates-header {
    text-align: center;
    margin-bottom: 3rem;
}

.templates-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary, #2d3748);
    margin-bottom: 0.75rem;
}

.templates-header p {
    font-size: 1.125rem;
    color: var(--text-secondary, #718096);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
}

.template-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    border-color: var(--primary, #667eea);
    transform: translateY(-5px);
}

.template-preview {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    padding: 2rem;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.preview-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.template-info {
    padding: 1.5rem;
}

.template-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.template-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #2d3748);
    margin-bottom: 0.75rem;
    text-align: center;
}

.template-description {
    font-size: 0.938rem;
    color: var(--text-secondary, #718096);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 3rem;
}

.template-example {
    background: var(--bg-secondary, #f7fafc);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border-left: 3px solid var(--primary, #667eea);
}

.example-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #667eea);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.25rem;
}

.example-text {
    font-size: 0.938rem;
    color: var(--text-primary, #2d3748);
    font-style: italic;
    display: block;
}

.template-select-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary, #667eea);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-select-btn:hover {
    background: var(--primary-dark, #5a67d8);
    transform: scale(1.02);
}

.template-select-btn:active {
    transform: scale(0.98);
}

/* Highlight selected template */
.template-card.selected {
    border-color: var(--primary, #667eea);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.template-card.selected .template-select-btn {
    background: var(--success, #48bb78);
}

.template-card.selected .template-select-btn::after {
    content: ' ✓';
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mode-templates {
        padding: 2rem 1rem;
    }
    
    .templates-header {
        margin-bottom: 2rem;
    }
    
    .templates-header h2 {
        font-size: 1.75rem;
    }
    
    .templates-header p {
        font-size: 1rem;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .template-preview {
        min-height: 150px;
        padding: 1.5rem;
    }
    
    .template-icon {
        font-size: 2.5rem;
    }
    
    .template-info h3 {
        font-size: 1.25rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Desktop - 4 columns for very wide screens */
@media (min-width: 1600px) {
    .templates-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mode-templates {
        background: transparent;
    }
    
    .template-card {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .template-card:hover {
        border-color: var(--primary, #667eea);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    }
    
    .template-preview {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-bottom-color: #4a5568;
    }
    
    .template-example {
        background: #2d3748;
    }
    
    .templates-header h2 {
        color: #e2e8f0;
    }
    
    .templates-header p {
        color: #a0aec0;
    }
    
    .template-info h3 {
        color: #e2e8f0;
    }
    
    .template-description {
        color: #a0aec0;
    }
    
    .example-text {
        color: #e2e8f0;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-card {
    animation: fadeInUp 0.5s ease-out;
}

.template-card:nth-child(1) { animation-delay: 0.05s; }
.template-card:nth-child(2) { animation-delay: 0.1s; }
.template-card:nth-child(3) { animation-delay: 0.15s; }
.template-card:nth-child(4) { animation-delay: 0.2s; }
.template-card:nth-child(5) { animation-delay: 0.25s; }
.template-card:nth-child(6) { animation-delay: 0.3s; }
.template-card:nth-child(7) { animation-delay: 0.35s; }
