/* Gravio Action Components Reference Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Navigation */
.top-navigation {
    background: #fff;
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    text-align: right;
}

.navigation {
    background: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navigation a, .top-navigation a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.navigation a:hover, .top-navigation a:hover {
    text-decoration: underline;
}

.lang-switch {
    background: #007bff;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.lang-switch:hover {
    background: #0056b3 !important;
    text-decoration: none !important;
}

.back-to-main {
    background: #6c757d;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    margin-right: 1rem;
    text-decoration: none !important;
}

.back-to-main:hover {
    background: #5a6268 !important;
    text-decoration: none !important;
}

.has-translation {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
}

/* Headers */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.component-header {
    background: #fff;
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.component-header h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.component-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Content */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.component-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.component-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.component-card h3 {
    margin-bottom: 1rem;
}

.component-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.component-card h3 a:hover {
    color: #007bff;
}

.component-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.component-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
}

.content-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-section h2 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.content-section h3 {
    color: #2c3e50;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
}

.content-section h4 {
    color: #495057;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.component-description {
    margin: 0;
}

.component-description p {
    margin: 0 0 1rem 0;
}

.component-description p:last-child {
    margin-bottom: 0;
}

/* Images */
.component-image {
    max-width: 100%;
    height: auto;
    margin: 0.75rem 0;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

/* Tables */
.component-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.component-table th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
}

.component-table th:first-child {
    width: 180px;
    min-width: 150px;
}

.component-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.component-table td:first-child {
    width: 180px;
    min-width: 150px;
    font-weight: 500;
}

/* Appendix section styling */
.appendix-section {
    background: #fff;
    margin: 1.5rem auto;
    padding: 1.5rem;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    min-height: auto;
    overflow: visible;
    display: block;
    width: calc(100% - 3rem);
    position: relative;
    clear: both;
}

.appendix-section h2 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    text-align: center;
    font-size: 1.5rem;
}

.appendix-section p {
    margin: 1rem 0;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: block;
}

.appendix-section p:first-of-type {
    margin-top: 0.5rem;
}

.appendix-section p:last-of-type {
    margin-bottom: 0.5rem;
}

.appendix-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    display: inline-block;
    border-radius: 4px;
    transition: color 0.2s ease;
    background: #f8f9fa;
    margin: 0.5rem 0;
    border: 1px solid #e9ecef;
}

.appendix-link:hover {
    color: #0056b3;
    text-decoration: underline;
    background: #e9ecef;
}

.component-table tr:hover {
    background: #f8f9fa;
}

.component-table tr:last-child td {
    border-bottom: none;
}

.component-table code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Code and links */
code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    word-break: break-word;
}

p code {
    margin: 0 1px;
}

a {
    color: #007bff;
    word-break: break-word;
}

a:hover {
    color: #0056b3;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive */
/* Table of Contents styling */
.toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.toc > ul {
    margin: 0;
}

.toc ul ul {
    padding-left: 2rem;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.toc li {
    margin: 0.75rem 0;
}

.toc a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    line-height: 1.5;
}

.toc a:hover {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #004494;
    transform: translateX(5px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Main section styling */
.toc a.toc-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    background: #ffffff;
    border: 2px solid #dee2e6;
    margin: 0.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toc a.toc-main:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

/* Sub-section styling */
.toc ul ul a {
    font-weight: 500;
    font-size: 1rem;
    color: #6c757d;
    padding: 0.6rem 1rem;
    margin: 0.25rem 0;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.toc ul ul a:hover {
    background: #f1f8e9;
    border-color: #c8e6c9;
    color: #2e7d32;
    transform: translateX(3px);
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 2rem 1rem;
    }
    
    .main-header h1 {
        font-size: 2rem;
    }
    
    .components-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .component-content {
        padding: 0.5rem 1rem 1rem;
    }
    
    .content-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .component-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toc {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .toc ul ul {
        padding-left: 1rem;
    }

    .top-navigation {
        padding: 0.5rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        text-align: center;
    }

    .back-to-main {
        margin-right: 0;
        order: 1;
    }

    .lang-switch {
        order: 2;
    }
}
