* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

header {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

header h1 i {
    margin-right: 10px;
    color: #3498db;
    font-size: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filter-item {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-item i {
    position: absolute;
    left: 10px;
    color: #2c3e50;
}

select {
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    border-radius: 20px;
    border: none;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    cursor: pointer;
}

select:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

main {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 130px);
}

.sidebar {
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-right: 1px solid #ddd;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    color: #2c3e50;
}

.sidebar h2 i {
    margin-right: 8px;
    color: #3498db;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

#search-input {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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

.list-container {
    height: calc(100vh - 220px);
    overflow-y: auto;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.road-item {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.road-item:before {
    content: '\f018';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.road-item:hover {
    background-color: #f0f7fa;
    transform: translateX(5px);
}

.road-item.active {
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    margin: 2px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.road-item.active:before {
    color: #fff;
}

.content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#road-details {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
}

#road-details h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    color: #2c3e50;
}

#road-details h2 i {
    margin-right: 10px;
    color: #3498db;
}

#road-info {
    margin-bottom: 2rem;
}

.road-details-flex {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.road-details-half {
    width: 50%;
    min-width: 0;
}
.road-details-square {
    flex: 1 1 0;
    min-width: 0;
    background: #3498db;
    border-radius: 10px;
    margin-left: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 2px 8px rgba(52,152,219,0.2);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.preview-map-btn {
    margin-bottom: 6px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: #3498db;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background 0.2s;
}
.preview-map-btn:disabled {
    background: #eee;
    color: #aaa;
    cursor: not-allowed;
}
.road-map {
    width: 100%;
    min-height: 300px;
    height: 300px;
    border-radius: 8px;
    background: #eaf6fb;
    margin: 10px auto 0 auto;
    box-shadow: 0 1px 4px rgba(52,152,219,0.08);
    position: relative;
    z-index: 1;
    display: block;
}

.no-road-selected {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #7f8c8d;
}

.no-road-selected i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #bdc3c7;
}

.no-road-selected p {
    font-size: 1.2rem;
    font-weight: 500;
}

.info-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.info-row:hover {
    background-color: #edf2f7;
}

.info-label {
    font-weight: bold;
    color: #2c3e50;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    padding: 0.7rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.tab-button i {
    margin-right: 8px;
}

.tab-button:hover {
    background-color: #f0f0f0;
    color: #2c3e50;
}

.tab-button.active {
    border-bottom: 3px solid #3498db;
    font-weight: bold;
    color: #2c3e50;
    background-color: #f8f9fa;
}

.format-content {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border: 1px solid #ddd;
    min-height: 200px;
}

.format-item {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.format-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.format-item h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.format-item h3::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #3498db;
}

.format-item h3:contains('GEOJSON')::before {
    content: '\f5a0'; /* map icon */
}

.format-item h3:contains('GPX')::before {
    content: '\f6ec'; /* hiking icon */
}

.format-item h3:contains('KML')::before {
    content: '\f57d'; /* globe icon */
}

.format-item p {
    margin-bottom: 0.8rem;
    color: #555;
    display: flex;
    align-items: center;
}

.format-item p strong {
    color: #2c3e50;
    margin-right: 5px;
    display: inline-block;
    min-width: 120px;
}

.format-item a {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 250px;
}

.format-item a:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.format-item a::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f019'; /* download icon */
    margin-right: 10px;
}

.categories-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.categories-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    color: #2c3e50;
}

.categories-section h2 i {
    margin-right: 10px;
    color: #3498db;
}

.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.category-item {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: #2ecc71;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.category-item h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.category-item h3::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f5a0'; /* map icon */
    margin-right: 10px;
    color: #2ecc71;
}

.category-item p {
    color: #555;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.category-item p::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f018'; /* road icon */
    margin-right: 10px;
    color: #7f8c8d;
}

.category-item .format-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.category-item a {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.2rem;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.3);
}

.category-item a:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.category-item a::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f019'; /* download icon */
    margin-right: 8px;
}

.no-categories {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.no-categories i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e74c3c;
}

.no-categories p {
    font-size: 1.2rem;
    font-weight: 500;
}

.no-formats {
    color: #e74c3c;
    font-style: italic;
}

footer {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: #fff;
    text-align: center;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-icons {
    display: flex;
    gap: 1.5rem;
    font-size: 1.3rem;
}

.footer-icons i {
    color: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-icons i:hover {
    transform: scale(1.2) rotate(10deg);
    color: #2ecc71;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Pulse animation for new items */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Responsiveness */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .list-container {
        height: 300px;
    }
    
    .categories-list {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .filters {
        width: 100%;
        justify-content: center;
    }
}
