:root{
  --light-blue-color: #007BC4;
  --dark-blue-color: #002B4A;
  --text-button-color: #FFFFFF;
  --text-color: #002B4A;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 0;
    margin:0;
}
p {
    margin-bottom: 14px; 
}
#total{
    margin-top:20px;
    margin-bottom:20px;
}
.banda{
    height:60px;
    background-color:var(--dark-blue-color);
    background-image:url("crg-logo.png");
    background-position: 10px center;            
    background-repeat: no-repeat;                 
    background-size: contain; 
    margin-bottom:20px;
}
.container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    __grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding:10px 40px;
}


.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}




.card-header {
    background: var(--light-blue-color);
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color:var(--text-button-color);
}

.nivel{
	border-right: 2px solid white;
	padding:4px 20px;
	font-size:1.2em;	
}

.materia{
	padding:4px 20px;
	font-size:1.2em;
}


.card-body {
    padding: 25px 20px;
}

.card-title {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.4;
}

.card-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.card-image {
    flex-shrink: 0;
}

.card-image img {
    margin-top:10px;
    width: 320px;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-description {
    flex: 1;
    color: var(--text-color);
}

.card-description p {
    font-size: 0.95rem;
    line-height: 1.6;
}


.card-footer {
    padding: 20px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: var(--text-color);
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    __border: 2px solid #667eea;
}
.catalog-header{
text-align:center;
color: var(--dark-blue-color);
}
.search-container {
    max-width: 1400px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
    margin-top:40px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 6px 50px 6px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    outline: none;
    border: 1px solid var(--light-blue-color);
    transition: box-shadow 0.3s ease;
}

.search-input:focus {

}

.search-button {
    padding: 15px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-button-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-button-reset {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.search-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.search-stats {
    color: white;
    font-size: 0.95rem;
    opacity: 0.9;
}

.no-results {
    text-align: center;
    color: white;
    padding: 40px;
    font-size: 1.2rem;
    display: none;
}

.no-results.show {
    display: block;
}

.invisible{
display:none;
}
.loading-container {
    text-align: center;
    padding: 10px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.spinner {
    border: 4px solid #e0e0e0;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.loading-container .info {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

.loading-container .info-small {
    font-size: 12px;
    color: #999;
    margin: 10px 0;
}

.loading-container .success {
    color: #28a745;
    font-weight: bold;
}

.loading-container .error {
    color: #dc3545;
    font-weight: bold;
}

.btn-refresh {
    margin-top: 15px;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-refresh:hover {
    background: #0056b3;
}
@media (max-width: 768px) {
    .card-content {
        flex-direction: column;
        align-items: center;
        text-align: left;
    }
    
    .card-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
    
    .search-button-clear {
        position: relative;
        right: auto;
        width: 100%;
        border-radius: 50px;
        margin-top: 10px;
    }
    
    .search-actions {
        flex-direction: column;
        gap: 10px;
    }
}
@media print {

    @page {
        size: A4;
        margin: 2cm; 
    }


    nav, footer, .boton-descarga, .sidebar {
        display: none !important;
    }


    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-size: 11pt;
        line-height: 1.5;
        color: #000;
        background: none;
    }


    p {
        margin-bottom: 0.5cm;
        orphans: 3; 
        widows: 3;  
    }


    h1, h2 {
        page-break-after: avoid; 
        color: #000;
    }

    .card {
        page-break-before: always;
        box-shadow: none;        
    }

.card-content {
text-align:left;
}
.card-image img {
    margin-top:10px;
    width: 220px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.card-description {
    font-size: 11px;
    line-height: 1.2;
    text-align:left;
}

.card-description p {
    font-size: 11px;
    line-height: 1.2;
    text-align:left;
}
}
