* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Filter Navigation */
.filter-nav {
    background-color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filter-nav .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Structure Detail */
.detail-header {
    margin: 2rem 0 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.back-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.viewer-placeholder {
    width: 100%;
    height: 420px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.08) 0%, rgba(52, 152, 219, 0.10) 100%);
    border: 2px dashed rgba(44, 62, 80, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: var(--light-text);
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    background-color: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--dark-text);
    text-decoration: none;
    display: inline-block;
}

.filter-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.filter-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.filter-btn.active {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* Search Box */
.search-box {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#searchInput {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--secondary-color);
}

#searchBtn {
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Structures Grid */
.structures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding-bottom: 3rem;
}

.structure-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.structure-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.structure-card.hidden {
    display: none;
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--light-bg);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-description {
    font-size: 0.95rem;
    color: var(--light-text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--light-bg);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--white);
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

#modalImage {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#modalTitle {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

#modalDescription {
    font-size: 1.05rem;
    color: var(--light-text);
    line-height: 1.7;
}

.modal-properties h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.modal-properties ul {
    list-style: none;
}

.modal-properties li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-bg);
    font-size: 0.95rem;
}

.modal-properties li:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .structures-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
    }

    .filter-nav .container {
        flex-direction: column;
    }

    .category-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .structures-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}
