* {
    box-sizing: border-box;
}

body {
    font-family: "Roboto", sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    background-color: #f3f3f3;
    color: #333;
}

.dark body {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.container {
    display: flex;
    width: 100%;
    flex-direction: row;
}

.sidebar {
    width: 260px;
    background-color: #ffffff;
    padding: 20px;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.1);
    transition: background 0.3s, color 0.3s;
}

.dark .sidebar {
    background-color: #2b2b2b;
    border-right: 1px solid rgba(255,255,255,0.1);
    color: #e0e0e0;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.category-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.15);
    margin-bottom: 15px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s, background 0.2s;
}

.category-search:focus {
    border-color: #6200ea;
}

.dark .category-search {
    border: 1px solid rgba(255,255,255,0.2);
    background-color: #3a3a3a;
    color: #e0e0e0;
}

.categories a {
    display: block;
    padding: 12px 16px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #444;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    font-size: 15px;
}

.dark .categories a {
    color: #e0e0e0;
    background: #3a3a3a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.categories a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #f5f5f5;
}

.dark .categories a:hover {
    background: #505050;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.categories a.active {
    background: #6200ea;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(98,0,234,0.4);
}

.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
    height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.dark .main-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.content-section {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.3s, color 0.3s;
}

.dark .content-section {
    background: #2b2b2b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.content-section.active {
    display: block;
}

.medal-card {
    margin-top: 16px;
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: background 0.3s, box-shadow 0.3s;
}

.dark .medal-card {
    background: #2b2b2b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.medal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.medal-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    min-height: 56px;
    transition: all 0.25s;
}

.dark .medal-mini {
    background: #3a3a3a;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.medal-coin {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: radial-gradient(circle at 30% 25%, #fff1b8, #ffd54a 40%, #f2b10a 100%);
}

.medal-name {
    flex-grow: 1;
    font-weight: 500;
    font-size: 14px;
}

.open-tag {
    border: none;
    background: #ffb74d;
    color: #000;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, background .3s;
}

.open-tag:active {
    transform: scale(.95);
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.modal-content {
    position: relative;
    width: min(560px, 92%);
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: auto;
    transition: background 0.3s, color 0.3s;
}

.dark .modal-content {
    background: #2b2b2b;
    color: #e0e0e0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.modal-list {
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-item {
    padding: 10px 14px;
    border-radius: 10px;
    background: #f6f6f6;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.dark .modal-item {
    background: #3a3a3a;
    color: #e0e0e0;
}

/* Responsive: móviles y tablets */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
        padding: 15px;
    }

    .main-content {
        margin-left: 220px;
        padding: 20px;
    }

    .categories a {
        font-size: 14px;
        padding: 10px 14px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }
}
