/* ============================================
   HTACCESS-GENERATOR.HTML - SAYFA ÖZEL STİLLER
   htaccess Generator - Apache Yapılandırma Aracı
   ============================================ */

/* 1. MODERN BUTTONS (GRADIENT + GLASSMORPHISM) */

/* Primary Button */
.primary-btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:disabled {
    cursor: not-allowed;
}

/* Secondary Button */
.secondary-btn {
    padding: 0.875rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: var(--primary, #26bcc2);
}

.secondary-btn:disabled {
    cursor: not-allowed;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}

/* 2. CARD STYLES */

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(38, 188, 194, 0.1), rgba(14, 165, 233, 0.1));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px 16px 0 0;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
}

.card-header i {
    color: var(--primary, #26bcc2);
    font-size: 1.5rem;
}

/* Editor Card */
.editor-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.editor-card:hover {
    box-shadow: 0 12px 40px rgba(38, 188, 194, 0.15);
    border-color: rgba(38, 188, 194, 0.3);
}

.editor-card:last-child {
    margin-bottom: 0;
}

/* Card Body Padding - Sadece kenar boşlukları */
.editor-card > :not(.card-header) {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* İlk içerik elementi için üst boşluk */
.editor-card .card-header + * {
    padding-top: 1rem;
}

/* Son element için alt boşluk */
.editor-card > :last-child:not(.card-header) {
    padding-bottom: 1rem;
}

/* İç elementlerin padding'i sıfırla - kendi margin'larını kullansınlar */
.editor-card .form-group,
.editor-card .action-buttons,
.editor-card .redirects-container,
.editor-card .preview-container,
.editor-card #errorPagesGroup {
    padding: 0;
}

/* 3. FORM STYLES */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 0.25rem;
}

/* 4. LAYOUT STYLES */

/* 2-Column Grid Layout */
.htaccess-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .htaccess-main-grid {
        grid-template-columns: 1fr;
    }
}

/* htaccess Editor Card */
.htaccess-editor-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.htaccess-editor-card:hover {
    box-shadow: 0 12px 40px rgba(38, 188, 194, 0.15);
    border-color: rgba(38, 188, 194, 0.3);
}

.htaccess-editor-card:last-child {
    margin-bottom: 0;
}

/* htaccess Card Titles */
.htaccess-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.htaccess-card-title i {
    font-size: 1.5rem;
}

/* Primary (Turkuaz) */
.htaccess-title-primary {
    color: var(--primary, #26bcc2);
}

.htaccess-title-primary i {
    color: var(--primary, #26bcc2);
}

/* Purple */
.htaccess-title-purple {
    color: #a78bfa;
}

.htaccess-title-purple i {
    color: #a78bfa;
}

/* Green */
.htaccess-title-green {
    color: #22c55e;
}

.htaccess-title-green i {
    color: #22c55e;
}

/* Yellow */
.htaccess-title-yellow {
    color: #eab308;
}

.htaccess-title-yellow i {
    color: #eab308;
}

/* Red */
.htaccess-title-red {
    color: #ef4444;
}

.htaccess-title-red i {
    color: #ef4444;
}

/* Indigo */
.htaccess-title-indigo {
    color: #6366f1;
}

.htaccess-title-indigo i {
    color: #6366f1;
}

/* htaccess Form Label */
.htaccess-form-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main, #e2e8f0);
    margin-bottom: 0.25rem;
}

/* Light Mode - htaccess Specific */
@media (prefers-color-scheme: light) {
    .htaccess-editor-card {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    }

    .htaccess-editor-card:hover {
        box-shadow: 0 12px 40px rgba(38, 188, 194, 0.12);
        border-color: rgba(38, 188, 194, 0.3);
    }

    .htaccess-card-title {
        border-bottom-color: rgba(0, 0, 0, 0.1);
    }

    .htaccess-form-label {
        color: #1e293b;
    }
}

/* Preview Container */
.preview-container {
    margin-bottom: 1rem;
}

/* 5. LIGHT MODE OVERRIDES FOR BUTTONS/CARDS */

@media (prefers-color-scheme: light) {
    .card-header {
        background: linear-gradient(135deg, rgba(38, 188, 194, 0.08), rgba(14, 165, 233, 0.08));
        border-bottom-color: rgba(0, 0, 0, 0.1);
    }

    .card-header h2 {
        color: #1e293b;
    }

    .editor-card {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    }

    .editor-card:hover {
        box-shadow: 0 12px 40px rgba(38, 188, 194, 0.12);
        border-color: rgba(38, 188, 194, 0.3);
    }

    .form-group label {
        color: #1e293b;
    }
}

/* 6. HTACCESS SPECIFIC STYLES */

/* Redirects Container */
.redirects-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    min-height: 50px;
}

/* Redirect Entry */
.redirect-entry {
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.redirect-entry:hover {
    border-color: var(--primary, #26bcc2);
    box-shadow: 0 4px 20px rgba(38, 188, 194, 0.1);
}

/* Redirect Header */
.redirect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.redirect-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary, #26bcc2), var(--success, #0ea5e9));
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
}

.remove-redirect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-redirect-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

/* Redirect Fields */
.redirect-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .redirect-fields {
        grid-template-columns: 1fr;
    }
}

/* htaccess Input */
.htaccess-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9375rem;
    font-family: "Courier New", Courier, monospace;
    transition: all 0.3s ease;
}

.htaccess-input:hover {
    border-color: var(--primary, #26bcc2);
}

.htaccess-input:focus {
    outline: none;
    border-color: var(--primary, #26bcc2);
    box-shadow: 0 0 0 3px rgba(38, 188, 194, 0.1);
}

.htaccess-input::placeholder {
    color: var(--text-muted, rgba(226, 232, 240, 0.4));
}

/* htaccess Select */
.htaccess-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.htaccess-select:hover {
    border-color: var(--primary, #26bcc2);
}

.htaccess-select:focus {
    outline: none;
    border-color: var(--primary, #26bcc2);
    box-shadow: 0 0 0 3px rgba(38, 188, 194, 0.1);
}

/* Preview Textarea */
.htaccess-preview {
    width: 100%;
    min-height: 500px;
    padding: 1rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.htaccess-preview:focus {
    outline: none;
    border-color: var(--primary, #26bcc2);
    box-shadow: 0 0 0 3px rgba(38, 188, 194, 0.1);
}

.htaccess-preview::placeholder {
    color: var(--text-muted, rgba(226, 232, 240, 0.4));
}

/* Info Alert */
.info-alert {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.info-alert i {
    color: #0ea5e9;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-alert div {
    flex: 1;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.info-alert strong {
    color: #0ea5e9;
    font-weight: 600;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary, #26bcc2);
}

.checkbox-label span {
    font-size: 0.9375rem;
    color: var(--text-primary, #e2e8f0);
}

/* Form Help */
.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted, rgba(226, 232, 240, 0.6));
}

/* Card Spacing */
.editor-card {
    margin-bottom: 1.5rem;
}

.editor-card:last-child {
    margin-bottom: 0;
}

/* 7. ANIMATIONS */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 8. DARK MODE ADJUSTMENTS */
@media (prefers-color-scheme: dark) {
    .redirect-entry {
        background: rgba(255, 255, 255, 0.03);
    }

    .htaccess-input,
    .htaccess-select {
        background: rgba(255, 255, 255, 0.03);
    }

    .htaccess-preview {
        background: rgba(0, 0, 0, 0.2);
    }
}

/* 9. LIGHT MODE OVERRIDES (SPECIFIC) */
@media (prefers-color-scheme: light) {
    .redirect-entry {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.1);
    }

    .redirect-entry:hover {
        box-shadow: 0 4px 20px rgba(38, 188, 194, 0.15);
    }

    .redirect-header {
        border-bottom-color: rgba(0, 0, 0, 0.1);
    }

    .htaccess-input,
    .htaccess-select {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }

    .htaccess-input::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .htaccess-preview {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }

    .htaccess-preview::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .checkbox-label span {
        color: #1e293b;
    }

    .form-help {
        color: rgba(0, 0, 0, 0.6);
    }

    .info-alert {
        background: rgba(14, 165, 233, 0.1);
        border-color: rgba(14, 165, 233, 0.4);
    }

    .info-alert div {
        color: #1e293b;
    }
}

/* 10. PRINT STYLES */
@media print {
    .redirect-header,
    .remove-redirect-btn,
    .action-buttons,
    .info-alert {
        display: none;
    }

    .redirect-entry,
    .editor-card {
        break-inside: avoid;
    }
}

/* 11. RESPONSIVE ADJUSTMENTS */
@media (max-width: 1024px) {
    .htaccess-preview {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .info-alert {
        flex-direction: column;
        gap: 0.75rem;
    }

    .info-alert i {
        font-size: 1.25rem;
    }
}

/* 12. EMPTY STATE */
.redirects-container:empty::before {
    content: 'Henüz yönlendirme eklenmedi. "Yönlendirme Ekle" butonuna tıklayarak başlayın.';
    display: block;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, rgba(226, 232, 240, 0.6));
    font-size: 0.9375rem;
    border: 2px dashed var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
}

@media (prefers-color-scheme: light) {
    .redirects-container:empty::before {
        color: rgba(0, 0, 0, 0.6);
        border-color: rgba(0, 0, 0, 0.1);
    }
}

/* 13. FOCUS VISIBLE */
.htaccess-input:focus-visible,
.htaccess-select:focus-visible,
.htaccess-preview:focus-visible {
    outline: 2px solid var(--primary, #26bcc2);
    outline-offset: 2px;
}

/* 14. DISABLED STATE */
.htaccess-input:disabled,
.htaccess-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================
   İYİLEŞTİRMELER - ERROR HANDLING & ACCESSIBILITY
   ============================================ */

/* Error Message Styling */
.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.input-error {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible Enhancement */
.htaccess-input:focus-visible,
.htaccess-select:focus-visible,
.htaccess-preview:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.remove-redirect-btn:focus-visible {
    outline: 3px solid var(--primary, #26bcc2);
    outline-offset: 2px;
}

/* Keyboard Navigation Indicator */
*:focus-visible {
    outline: 2px solid var(--primary, #26bcc2);
    outline-offset: 2px;
}

/* Loading State */
.primary-btn.loading,
.secondary-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.primary-btn.loading::after,
.secondary-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Success State */
.input-success {
    border-color: #22c55e !important;
}

/* Light Mode - Error Styling */
@media (prefers-color-scheme: light) {
    .error-message {
        color: #dc2626;
    }
    
    .input-error {
        background-color: rgba(239, 68, 68, 0.08) !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .input-error {
        border-width: 2px;
    }
    
    .error-message {
        font-weight: 600;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .redirect-entry,
    .primary-btn,
    .secondary-btn,
    .htaccess-input,
    .htaccess-select {
        transition: none;
        animation: none;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    .primary-btn,
    .secondary-btn,
    .remove-redirect-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .htaccess-input,
    .htaccess-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Print Optimization */
@media print {
    .action-buttons,
    .remove-redirect-btn,
    .info-alert,
    .cookie-banner,
    header,
    footer,
    nav {
        display: none !important;
    }
    
    .htaccess-preview {
        border: 1px solid #000;
        font-family: 'Courier New', monospace;
        font-size: 10pt;
        line-height: 1.4;
        page-break-inside: avoid;
    }
    
    .redirect-entry,
    .editor-card,
    .htaccess-editor-card {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* CSS Custom Properties for Theming */
:root {
    --color-purple: #a78bfa;
    --color-blue: #0ea5e9;
    --color-green: #22c55e;
    --color-yellow: #eab308;
    --color-red: #ef4444;
    --color-indigo: #6366f1;
    --color-primary: #26bcc2;
}

/* Tooltip Support */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Improved Empty State */
.redirects-container:empty {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.redirects-container:empty::before {
    content: 'Henüz yönlendirme eklenmedi. "Yönlendirme Ekle" butonuna tıklayarak başlayın.';
    display: block;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, rgba(226, 232, 240, 0.6));
    font-size: 0.9375rem;
    border: 2px dashed var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    width: 100%;
}

@media (prefers-color-scheme: light) {
    .redirects-container:empty::before {
        color: rgba(0, 0, 0, 0.6);
        border-color: rgba(0, 0, 0, 0.1);
    }
}


/* Keyboard Shortcut Display */
kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    color: #1e293b;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    kbd {
        color: #e2e8f0;
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Improved Info Alert Spacing */
.info-alert div br {
    line-height: 1.8;
}

/* Animation for Success/Error States */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.input-error {
    animation: shake 0.5s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .input-error {
        animation: none;
    }
}


/* ============================================
   ADVANCED FEATURES - Templates, Toolbar, Modals
   ============================================ */

/* Templates Section */
.templates-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.templates-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #e2e8f0);
}

.templates-title i {
    color: var(--primary, #26bcc2);
    font-size: 1.5rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary, #26bcc2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(38, 188, 194, 0.2);
}

.template-card i {
    font-size: 2.5rem;
    color: var(--primary, #26bcc2);
}

.template-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #e2e8f0);
}

.template-card p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-muted, rgba(226, 232, 240, 0.6));
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary, #26bcc2);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, var(--primary, #26bcc2), #0ea5e9);
    border-color: transparent;
    color: white;
}

.toolbar-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(38, 188, 194, 0.3);
    transform: translateY(-1px);
}

.toolbar-btn-warning {
    background: linear-gradient(135deg, #eab308, #f97316);
    border-color: transparent;
    color: white;
}

.toolbar-btn-warning:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
    transform: translateY(-1px);
}

/* Redirect Actions */
.redirect-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg, rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #e2e8f0);
}

.modal-title i {
    color: var(--primary, #26bcc2);
}

/* Performance Score Display */
.score-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(38, 188, 194, 0.2), rgba(14, 165, 233, 0.2));
    border: 3px solid var(--primary, #26bcc2);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary, #26bcc2);
}

.score-max {
    font-size: 1rem;
    color: var(--text-muted, rgba(226, 232, 240, 0.6));
}

.score-info {
    flex: 1;
}

.score-grade {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1.25rem;
    color: var(--text-muted, rgba(226, 232, 240, 0.8));
}

/* Recommendations */
.recommendations h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #e2e8f0);
}

.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid;
    border-radius: 8px;
}

.recommendation-critical {
    border-color: #ef4444;
}

.recommendation-high {
    border-color: #f97316;
}

.recommendation-medium {
    border-color: #eab308;
}

.recommendation-low {
    border-color: #22c55e;
}

.recommendation-item i {
    color: #eab308;
    margin-top: 0.125rem;
}

/* Conflicts */
.conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.conflict-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid;
    border-radius: 8px;
}

.conflict-error {
    border-color: #ef4444;
}

.conflict-warning {
    border-color: #eab308;
}

.conflict-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.conflict-header i {
    margin-top: 0.125rem;
}

.conflict-error .conflict-header i {
    color: #ef4444;
}

.conflict-warning .conflict-header i {
    color: #eab308;
}

.conflict-solution {
    margin-left: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted, rgba(226, 232, 240, 0.7));
}

.no-conflicts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    font-size: 1.125rem;
    color: #22c55e;
}

.no-conflicts i {
    font-size: 2rem;
}

/* Light Mode */
@media (prefers-color-scheme: light) {
    .templates-section,
    .toolbar {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .template-card {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .template-card:hover {
        background: rgba(38, 188, 194, 0.05);
    }
    
    .template-card h3,
    .templates-title {
        color: #1e293b;
    }
    
    .toolbar-btn {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }
    
    .toolbar-btn:hover:not(:disabled) {
        background: rgba(38, 188, 194, 0.05);
    }
    
    .modal-content {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .modal-title,
    .score-label,
    .recommendations h3 {
        color: #1e293b;
    }
    
    .modal-close {
        background: rgba(0, 0, 0, 0.05);
        color: #1e293b;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .toolbar-group {
        width: 100%;
    }
    
    .toolbar-btn {
        flex: 1;
        justify-content: center;
    }
    
    .score-display {
        flex-direction: column;
        text-align: center;
    }
    
    .redirect-actions {
        flex-direction: column;
    }
    
    .redirect-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: fadeIn 0.3s ease 0.1s both;
}


/* Syntax Highlighting */
.syntax-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.syntax-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary, #26bcc2);
}

.htaccess-highlighted {
    width: 100%;
    min-height: 500px;
    background: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: auto;
}

.htaccess-highlighted pre {
    margin: 0;
    padding: 1rem;
}

.htaccess-highlighted code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Prism Theme Overrides */
.htaccess-highlighted .token.comment {
    color: #6a9955;
}

.htaccess-highlighted .token.keyword {
    color: #569cd6;
}

.htaccess-highlighted .token.string {
    color: #ce9178;
}

.htaccess-highlighted .token.number {
    color: #b5cea8;
}

.htaccess-highlighted .token.operator {
    color: #d4d4d4;
}

@media (prefers-color-scheme: light) {
    .syntax-toggle-btn {
        background: white;
        border-color: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }
    
    .htaccess-highlighted {
        background: #f5f5f5;
    }
}

/* Documentation Tooltips */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--primary, #26bcc2);
    font-size: 0.75rem;
    cursor: help;
    transition: all 0.3s ease;
}

.info-tooltip:hover {
    background: rgba(38, 188, 194, 0.2);
    transform: scale(1.1);
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 6px;
    white-space: normal;
    max-width: 250px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

@media (prefers-color-scheme: light) {
    .info-tooltip {
        background: rgba(0, 0, 0, 0.05);
    }
    
    [data-tooltip]::before {
        background: rgba(0, 0, 0, 0.85);
    }
    
    [data-tooltip]::after {
        border-top-color: rgba(0, 0, 0, 0.85);
    }
}
