/* ========================================
   NXP Serial Memory Tool Documentation Theme
   ======================================== */

/* Image captions using title attribute */
img[title] {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #e1e4e5;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Add visible captions below images */
img[title]:after {
    content: attr(title);
    display: block;
    text-align: center;
    font-style: italic;
    margin: 8px 0 20px 0;
    padding: 5px 10px;
    color: #666;
    font-size: 0.9em;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Style for figure captions (if using MyST figure directive) */
.figure .caption {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* Improve table styling */
.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: normal;
}

table.docutils {
    border: none;
    border-collapse: collapse;
    margin: 20px 0;
    width: 100%;
}

table.docutils th {
    background-color: #2980b9;
    color: white;
    font-weight: bold;
    padding: 12px 8px;
    text-align: left;
    border: 1px solid #2980b9;
}

table.docutils td {
    padding: 10px 8px;
    border: 1px solid #e1e4e5;
    vertical-align: top;
}

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

table.docutils tbody tr:hover {
    background-color: #e8f4f8;
}

/* Code blocks styling */
.highlight pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Inline code styling */
code.literal {
    background-color: #f1f2f3;
    color: #e74c3c;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Note and warning boxes */
.admonition {
    margin: 20px 0;
    padding: 15px;
    border-left: 4px solid #2980b9;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.admonition-title {
    font-weight: bold;
    color: #2980b9;
    margin-bottom: 8px;
}

.admonition.note {
    border-left-color: #3498db;
}

.admonition.warning {
    border-left-color: #f39c12;
    background-color: #fef9e7;
}

.admonition.warning .admonition-title {
    color: #f39c12;
}

.admonition.error {
    border-left-color: #e74c3c;
    background-color: #fdf2f2;
}

.admonition.error .admonition-title {
    color: #e74c3c;
}

/* Improve navigation styling */
.wy-menu-vertical li.current > a {
    border-right: 2px solid #2980b9;
}

/* Custom styling for workflow diagram */
.workflow {
    text-align: center;
    font-family: monospace;
    font-size: 1.1em;
    background-color: #f8f9fa;
    padding: 20px;
    border: 2px solid #2980b9;
    border-radius: 8px;
    margin: 20px 0;
    color: #2c3e50;
}

/* Responsive image container */
.image-container {
    text-align: center;
    margin: 20px 0;
}

/* Logo styling */
.logo img {
    max-height: 40px;
    width: auto;
}

/* Print-friendly styles */
@media print {
    img[title]:after {
        page-break-inside: avoid;
    }
    
    .admonition {
        page-break-inside: avoid;
    }
    
    table.docutils {
        page-break-inside: auto;
    }
    
    table.docutils tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* Dark theme support (if enabled) */
@media (prefers-color-scheme: dark) {
    img[title]:after {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .figure .caption {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
}

/* Custom styles for specific content */
.system-requirements {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.key-features {
    background-color: #f0fff0;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.troubleshooting {
    background-color: #fff5f5;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}