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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
}

header h1 {
    margin-bottom: 20px;
    font-size: 2.5em;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.header-logo a {
    display: block;
    text-decoration: none;
}

.header-logo .logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.header-logo .logo:hover {
    transform: scale(1.05);
}

.header-logo h1 {
    margin-bottom: 0;
    flex: 1;
}

.header-actions {
    margin-bottom: 20px;
}

.admin-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: bold;
}

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

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: white;
    color: #2c3e50;
    border-color: white;
}

main {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section label {
    margin-right: 10px;
    font-weight: bold;
}

.filter-section select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

th, td {
    padding: 15px;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #667eea;
}

.form-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.form-container input,
.form-container select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.form-container input:focus,
.form-container select:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.2s;
}

.form-actions button:first-child {
    background: #28a745;
    color: white;
}

.form-actions button:first-child:hover {
    background: #218838;
}

.form-actions button:last-child {
    background: #6c757d;
    color: white;
}

.form-actions button:last-child:hover {
    background: #5a6268;
}

button.edit {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    transition: background 0.2s;
}

button.edit:hover {
    background: #e0a800;
}

button.delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

button.delete:hover {
    background: #c82333;
}

button.btn-view {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

button.btn-view:hover {
    background: #5568d3;
}

.clasificaciones-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.3s;
    font-weight: bold;
}

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

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

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

.dashboard-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #2c3e50;
}

.dashboard-card.highlight h3,
.dashboard-card.highlight p {
    color: white;
}

.dashboard-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.dashboard-card.highlight .btn-dashboard {
    background: white;
    color: #667eea;
}

.btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.category-standings-section {
    margin-bottom: 40px;
}

.category-standings-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    margin: 0;
    font-size: 1.4em;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.standings-detail-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.standings-detail-table thead {
    background: #f0f0f0;
}

.standings-detail-table th {
    padding: 12px 10px;
    text-align: left;
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.standings-detail-table .race-header {
    text-align: center;
    font-size: 0.85em;
}

.standings-detail-table .total-header {
    background: #667eea;
    color: white;
    text-align: center;
    font-size: 1em;
}

.standings-detail-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.standings-detail-table tbody tr:hover {
    background: #f8f9fa;
}

.standings-detail-table tbody tr:nth-child(1) {
    background: #ffd70033;
}

.standings-detail-table tbody tr:nth-child(2) {
    background: #c0c0c033;
}

.standings-detail-table tbody tr:nth-child(3) {
    background: #cd7f3233;
}

.standings-detail-table .pos-column {
    width: 50px;
    text-align: center;
}

.standings-detail-table .number-column {
    width: 80px;
    text-align: center;
}

.standings-detail-table .points-cell {
    text-align: center;
    color: #666;
}

.standings-detail-table .total-column {
    text-align: center;
    font-size: 1.1em;
    color: #667eea;
    background: #f8f9fa;
}

/* Technical Specification Table Styles */
.header-layout {
    width: 100%;
    margin-bottom: 20px;
    border: 2px solid #2c3e50;
}

.logo-box {
    width: 200px;
    padding: 20px;
    border-right: 2px solid #2c3e50;
    text-align: center;
}

.logo-placeholder {
    font-weight: bold;
    font-size: 1.5em;
    color: #2c3e50;
}

.logo-placeholder span {
    display: block;
    font-size: 0.8em;
    color: #667eea;
}

.title-box {
    padding: 20px;
    text-align: center;
}

.title-box h1 {
    color: #2c3e50;
    margin: 0;
}

.title-box p {
    color: #666;
    margin-top: 10px;
    font-size: 0.9em;
}

.spec-table {
    width: 100%;
    border: 2px solid #2c3e50;
    margin-top: 0;
}

.spec-table thead th {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.2em;
}

.spec-table .sub-header {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.spec-table .sub-header td {
    text-align: center;
    padding: 12px;
    border-left: 1px solid white;
}

.spec-table .sub-header td:first-child {
    border-left: none;
}

.spec-table .param-col {
    font-weight: bold;
    background: #f0f0f0;
    width: 19%;
    border-right: 2px solid #2c3e50;
}

.spec-table tbody td {
    padding: 12px;
    border: 1px solid #ddd;
    border-left: 1px solid #2c3e50;
    text-align: center;
}

.spec-table tbody td:first-child {
    text-align: left;
    border-left: none;
}

.spec-table tbody tr {
    border-bottom: 1px solid #2c3e50;
}

.spec-table .note-row td {
    background: #fffacd;
    font-style: italic;
}

.spec-table .section-col {
    font-weight: bold;
    background: #e8e8e8;
    border-right: 2px solid #2c3e50;
    text-align: center;
    vertical-align: middle;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 1.1em;
    text-transform: uppercase;
}

.spec-table .section-col + .param-col {
    text-align: right;
    padding-right: 15px;
}

.spec-table .cat-col {
    font-weight: bold;
    text-align: center;
    border-left: 1px solid white;
}

.spec-table .text-left {
    text-align: left !important;
}

/* Map Container */
.map-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    color: white;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1em;
    opacity: 0.4;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.7;
}

.social-btn.active {
    opacity: 1;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.social-btn.youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.social-btn.instagram {
    background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCAF45 100%);
}

.social-btn.facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0C63D4 100%);
}

.social-icon {
    font-size: 1.2em;
}

/* Video Gallery */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.video-item iframe {
    width: 100%;
    height: 200px;
    border: none;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    font-size: 1em;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-info p {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}

.video-info .video-date {
    color: #667eea;
    margin-top: 5px;
}

/* Facebook Video Preview Card */
.facebook-video-link {
    display: block;
    text-decoration: none;
}

.facebook-video-preview {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1877F2 0%, #0C63D4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.facebook-play-icon {
    font-size: 60px;
    color: white;
    z-index: 2;
    transition: transform 0.3s;
}

.facebook-video-preview:hover .facebook-play-icon {
    transform: scale(1.2);
}

.facebook-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.facebook-video-preview:hover .facebook-overlay {
    transform: translateY(0);
}

/* Calendar Styles */
.calendario-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.calendar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.calendar-body {
    padding: 20px;
}

.calendar-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.calendar-dates {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.calendar-date-item {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.calendar-date-item strong {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
}

.calendar-fechas {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.calendar-fechas h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

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

.fechas-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    transition: all 0.2s;
}

.fechas-list li:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.fechas-list li strong {
    color: #667eea;
    margin-right: 5px;
}

/* Historia with Images Layout */
.historia-with-images {
    max-width: 1200px;
    margin: 0 auto;
}

.historia-section {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.historia-section.reverse {
    flex-direction: row-reverse;
    background: white;
}

.historia-text {
    flex: 1;
    min-width: 0;
}

.historia-text h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.historia-text p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.historia-image {
    flex: 0 0 45%;
    max-width: 500px;
}

.historia-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.historia-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .historia-section,
    .historia-section.reverse {
        flex-direction: column;
    }

    .historia-image {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    nav {
        flex-direction: column;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px;
    }
}
