/**
 * Universal HTML Importer - Frontend Styles
 * Стилове за импортираното съдържание
 */

/* UHI Generated Content Base Styles */
.uhi-imported-content {
    line-height: 1.6;
    color: #333;
    font-family: inherit;
}

/* Headers */
.uhi-header {
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
    color: #2c3e50;
    position: relative;
}

.uhi-header:first-child {
    margin-top: 0;
}

.uhi-h1 {
    font-size: 2.5em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.3em;
}

.uhi-h2 {
    font-size: 2em;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.2em;
}

.uhi-h3 {
    font-size: 1.6em;
    color: #8e44ad;
}

.uhi-h4 {
    font-size: 1.3em;
    color: #27ae60;
}

.uhi-h5 {
    font-size: 1.1em;
    color: #f39c12;
}

.uhi-h6 {
    font-size: 1em;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Long headers */
.uhi-long-header {
    line-height: 1.3;
}

/* SEO optimized headers */
.uhi-seo-optimized::after {
    content: "✓";
    color: #27ae60;
    font-size: 0.8em;
    margin-left: 0.5em;
    opacity: 0.7;
}

/* Hierarchy fixed headers */
.uhi-hierarchy-fixed {
    border-left: 4px solid #f39c12;
    padding-left: 1em;
    background: rgba(243, 156, 18, 0.1);
}

/* Back to Top Links */
.uhi-back-to-top {
    display: inline-block;
    background: #3498db;
    color: white !important;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 16px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 100;
}

.uhi-back-to-top:hover {
    opacity: 1;
    transform: translateY(-2px);
    background: #2980b9;
}

/* Table of Contents */
.uhi-table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 2em 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.uhi-toc-title {
    margin-top: 0 !important;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.4em;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.uhi-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.uhi-toc-item {
    margin: 8px 0;
    position: relative;
}

.uhi-toc-link {
    color: #007cba;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.uhi-toc-link:hover {
    color: #005a8a;
    background: rgba(0, 124, 186, 0.1);
    padding-left: 10px;
}

/* TOC Level Indentation */
.uhi-toc-level-1 { margin-left: 0; }
.uhi-toc-level-2 { margin-left: 20px; }
.uhi-toc-level-3 { margin-left: 40px; }
.uhi-toc-level-4 { margin-left: 60px; }
.uhi-toc-level-5 { margin-left: 80px; }
.uhi-toc-level-6 { margin-left: 100px; }

/* TOC Level Styling */
.uhi-toc-level-1 .uhi-toc-link {
    font-weight: bold;
    font-size: 1.1em;
}

.uhi-toc-level-2 .uhi-toc-link {
    font-weight: 600;
}

.uhi-toc-level-3 .uhi-toc-link {
    font-style: italic;
}

.uhi-toc-level-4,
.uhi-toc-level-5,
.uhi-toc-level-6 {
    font-size: 0.9em;
    opacity: 0.8;
}

/* CTA Blocks */
.uhi-cta-block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.uhi-cta-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: bold;
}

.uhi-cta-description {
    margin-bottom: 20px;
    font-size: 1.1em;
    opacity: 0.9;
}

.uhi-cta-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none !important;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.uhi-cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* CTA Variations */
.uhi-cta-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.uhi-cta-success {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
}

.uhi-cta-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.uhi-cta-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Generated CSS Classes */
.uhi-gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
}

.uhi-rounded {
    border-radius: 8px;
}

.uhi-shadow {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.uhi-center {
    text-align: center;
}

.uhi-right {
    text-align: right;
}

.uhi-bold {
    font-weight: bold;
}

.uhi-italic {
    font-style: italic;
}

.uhi-white-text {
    color: white;
}

.uhi-padded {
    padding: 20px;
}

.uhi-spaced {
    margin: 20px 0;
}

/* Layout Classes */
.uhi-flex {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.uhi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.uhi-float-left {
    float: left;
    margin: 0 20px 20px 0;
}

.uhi-float-right {
    float: right;
    margin: 0 0 20px 20px;
}

/* Theme Classes */
.uhi-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.uhi-button {
    display: inline-block;
    background: #007cba;
    color: white !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.uhi-button:hover {
    background: #005a8a;
    transform: translateY(-1px);
}

/* Alert Boxes */
.uhi-highlight {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.uhi-warning {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
    color: #721c24;
}

.uhi-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
    color: #0c5460;
}

.uhi-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
    color: #155724;
}

/* Tables */
.uhi-styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.uhi-styled-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.uhi-styled-table th,
.uhi-styled-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.uhi-styled-table tbody tr {
    background: #fff;
    transition: background 0.2s ease;
}

.uhi-styled-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.uhi-styled-table tbody tr:hover {
    background: #e9ecef;
}

/* Blockquotes */
.uhi-quote {
    border-left: 4px solid #007cba;
    padding: 20px;
    margin: 20px 0;
    background: #f8f9fa;
    font-style: italic;
    position: relative;
}

.uhi-quote::before {
    content: '"';
    font-size: 4em;
    color: #007cba;
    position: absolute;
    top: -10px;
    left: 20px;
    opacity: 0.3;
}

/* Code Blocks */
.uhi-code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow-x: auto;
}

/* Social Links */
.uhi-social-link {
    display: inline-block;
    margin: 0 10px;
    padding: 10px 15px;
    background: #3498db;
    color: white !important;
    text-decoration: none !important;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.uhi-social-link:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.uhi-social-link[href*="facebook"] {
    background: #3b5998;
}

.uhi-social-link[href*="twitter"] {
    background: #1da1f2;
}

.uhi-social-link[href*="instagram"] {
    background: #e4405f;
}

/* Lists */
.uhi-list {
    margin: 20px 0;
    padding-left: 30px;
}

.uhi-list li {
    margin: 10px 0;
    line-height: 1.6;
}

/* Images */
.uhi-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* Gallery */
.uhi-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.uhi-gallery .uhi-image {
    margin: 0;
    transition: transform 0.2s ease;
}

.uhi-gallery .uhi-image:hover {
    transform: scale(1.05);
}

/* Accordion */
.uhi-accordion {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.uhi-accordion summary {
    background: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.uhi-accordion summary:hover {
    background: #e9ecef;
}

.uhi-accordion[open] summary {
    background: #007cba;
    color: white;
}

.uhi-accordion div {
    padding: 20px;
    background: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .uhi-h1 {
        font-size: 2em;
    }
    
    .uhi-h2 {
        font-size: 1.6em;
    }
    
    .uhi-h3 {
        font-size: 1.4em;
    }
    
    .uhi-flex {
        flex-direction: column;
    }
    
    .uhi-grid {
        grid-template-columns: 1fr;
    }
    
    .uhi-table-of-contents {
        padding: 15px;
    }
    
    .uhi-toc-level-2 { margin-left: 15px; }
    .uhi-toc-level-3 { margin-left: 30px; }
    .uhi-toc-level-4 { margin-left: 45px; }
    .uhi-toc-level-5 { margin-left: 60px; }
    .uhi-toc-level-6 { margin-left: 75px; }
    
    .uhi-cta-block {
        padding: 20px;
    }
    
    .uhi-float-left,
    .uhi-float-right {
        float: none;
        margin: 20px 0;
    }
    
    .uhi-styled-table {
        font-size: 0.9em;
    }
    
    .uhi-styled-table th,
    .uhi-styled-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .uhi-back-to-top {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
    
    .uhi-cta-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .uhi-gallery {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .uhi-back-to-top,
    .uhi-cta-block {
        display: none;
    }
    
    .uhi-table-of-contents {
        border: 1px solid #ccc;
        background: #f9f9f9;
    }
    
    .uhi-header {
        page-break-after: avoid;
    }
    
    .uhi-card,
    .uhi-quote {
        page-break-inside: avoid;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .uhi-imported-content {
        color: #e9ecef;
    }
    
    .uhi-header {
        color: #f8f9fa;
    }
    
    .uhi-table-of-contents {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .uhi-toc-title {
        color: #ecf0f1;
    }
    
    .uhi-toc-link {
        color: #3498db;
    }
    
    .uhi-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .uhi-code {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .uhi-quote {
        background: #2c3e50;
        border-color: #3498db;
        color: #ecf0f1;
    }
    
    .uhi-styled-table tbody tr {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .uhi-styled-table tbody tr:nth-child(even) {
        background: #34495e;
    }
    
    .uhi-styled-table tbody tr:hover {
        background: #3c5a78;
    }
}