/*
 * Hoja de estilos global para la documentación de la API RestMaster
 * Aplica a todos los controladores y endpoints
 */

/* Base styles for all pages */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #222;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles for general pages (like RMAddons/index.html) */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .icon {
    font-size: 1em;
    color: #e74c3c;
}

.header .subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Search container for general pages */
.search-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

#search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

#search-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Grid for controllers/modules */
.controllers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.controller-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.controller-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 2em;
    color: #e74c3c;
    margin-right: 20px;
}

.card-content h2 {
    color: #2c3e50;
    font-size: 1.4em;
    margin: 0 0 10px 0;
}

.card-content p {
    color: #7f8c8d;
    margin: 0 0 15px 0;
}

.card-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.card-link:hover {
    text-decoration: underline;
}

/* Footer styles */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Back link styles */
.back-link {
    display: inline-block;
    background: #f8f9fa;
    color: #4b2995;
    padding: 10px 22px;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 18px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.back-link:hover {
    background: #e0e0e0;
    color: #764ba2;
}

/* Page content layout (for detailed pages) */
.page-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.card h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.component-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.component-card:hover {
    background-color: #f0f0f0;
}

.component-card-link {
    text-decoration: none;
    color: inherit;
}

.component-icon {
    font-size: 1.8em;
    color: #e74c3c;
}

.component-text h4 {
    color: #34495e;
    font-size: 1.1em;
    margin: 0 0 5px 0;
}

.component-text p {
    color: #7f8c8d;
    margin: 0;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #34495e;
}

.features-list .fa-check-circle {
    color: #27ae60;
}

.component-details {
    margin-bottom: 20px;
}

.component-details h4 {
    color: #3498db;
    font-size: 1.2em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mermaid {
    text-align: center;
    margin-bottom: 10px;
}

.mermaid-caption {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

.flow-list {
    list-style: none;
    padding-left: 20px;
}

.flow-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
}

.flow-list li::before {
    content: counter(list-item);
    counter-increment: list-item;
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    text-align: center;
    font-size: 0.8em;
    line-height: 20px;
}

.info-box {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #222;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

.info-box h4 {
    color: #1976d2;
    margin-bottom: 10px;
}

.info-box ul {
    color: #1976d2;
    margin: 10px 0;
}

.code-example pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

/* Styles specific to RMKnowledge/index.html */
.main-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px; /* Increased padding for more visual space */
    background: linear-gradient(135deg, #4b2995 0%, #667eea 100%); /* Darker, more prominent background */
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3); /* Stronger shadow */
    position: relative; /* For icon positioning */
    overflow: hidden; /* Ensures icon stays within bounds */
}

.main-header h1 {
    color: white; /* Changed to white for better visibility */
    font-size: 3.5rem; /* Larger font size for impact */
    margin-bottom: 15px;
    text-shadow: 3px 3px 8px rgba(0,0,0,0.6); /* Stronger text shadow */
    position: relative; /* To layer above background elements */
    z-index: 1;
}

.main-header p {
    font-size: 1.3rem; /* Slightly larger subtitle */
    opacity: 0.95;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.header-icon {
    font-size: 8rem; /* Very large icon */
    color: rgba(255, 255, 255, 0.1); /* Subtle, transparent white */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0; /* Behind text */
    animation: rotateIcon 20s linear infinite; /* Subtle rotation animation */
}

@keyframes rotateIcon {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.search-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.search-section p {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 25px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.project-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.project-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.project-card p {
    color: #666;
    margin-bottom: 20px;
}

.project-card a {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.project-card a:hover {
    transform: scale(1.05);
}

.category {
    margin-bottom: 30px;
}

.category h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.quick-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quick-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Styles for the search input in RMKnowledge/index.html */
.search-input-container {
    position: relative;
    width: 80%;
    max-width: 500px;
    margin: 0 auto 20px auto;
}

.search-input-container .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    z-index: 1;
}

.search-input-container .search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #bdc3c7;
    border-radius: 25px;
    font-size: 1.1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.search-input-container .search-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.4);
}

.search-results {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 100;
    margin-top: 5px;
}

.search-results div {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-results div:last-child {
    border-bottom: none;
}

.search-results div:hover {
    background-color: #f0f0f0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .page-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .search-input-container {
        width: 95%;
    }
}