/* styles.css */
:root {
    --primary-bg: #000000;
    --secondary-bg: #1e1e1e;
    --text-color: #ffffff;
    --accent-color: #8b0000;
    --hover-accent: #333333;
    --border-color: #333333;
    --header-color: #ffffff;
    --search-border: #8b0000;
    --search-border-focus: #f44336;
    --transition-speed: 0.3s;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Light mode theme variables */
[data-theme="light"] {
    --primary-bg: #f0f5fa;
    --secondary-bg: #ffffff;
    --text-color: #1f2937;
    --accent-color: #2563eb;
    --hover-accent: #e5e7eb;
    --border-color: #d1d5db;
    --header-color: #1f2937;
    --search-border: #2563eb;
    --search-border-focus: #1d4ed8;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family), serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

h1, h2, h3 {
    color: var(--header-color);
    text-align: center;
    margin-bottom: 20px;
}

h3 {
    text-align: left;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--search-border);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.search-box:focus {
    outline: none;
    border-color: var(--search-border-focus);
}

.accordion {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 15px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition-speed);
}

.accordion:hover, .accordion:focus {
    background-color: var(--hover-accent);
    outline: none;
}

.accordion:after {
    content: '\25BC';
    font-size: 1rem;
    transition: transform var(--transition-speed);
}

.accordion.active:after {
    transform: rotate(180deg);
}

.panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease-out;
    padding: 0 15px;
    background-color: var(--primary-bg);
    border-left: 4px solid var(--accent-color);
    margin-bottom: 10px;
}

.panel.expanded {
    max-height: 600px;
    overflow-y: auto;
    transition: max-height var(--transition-speed) ease-in;
    padding: 15px;
}

/* Resource List Styles */
.resource-list {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
    list-style: none;
    padding: 0;
}

.resource-item {
    background-color: var(--secondary-bg);
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    flex: 1 1 calc(33.333% - 10px);
    margin: 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.planet-icon {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 10px;
}

.resource-item:hover, .resource-item:focus {
    background-color: var(--hover-accent);
    outline: none;
}

.resource-item.active {
    background-color: var(--hover-accent);
}

.resource-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    align-self: center;
}

.resource-title {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.resource-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    color: #cccccc;
    font-size: 0.95rem;
}

.resource-item.active .resource-details {
    display: block;
}

/* Favorite Button Styles */
.favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.favorite-button.active {
    color: gold;
}

/* Styles for Favorites Section */
.no-favorites {
    color: #cccccc;
    text-align: center;
    width: 100%;
    padding: 20px;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .resource-item {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .resource-item {
        flex: 1 1 100%;
    }

    .accordion {
        font-size: 1rem;
        padding: 10px;
    }

    .resource-details {
        font-size: 0.9rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    .resource-icon {
        width: 40px;
        height: 40px;
    }
}
