.gallery-controls {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 3fr;
    gap: 1rem 1.5rem;
    align-items: center;
    margin-top: 2.5rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #1e293b;
    border-radius: 0.5rem;
    border: 1px solid #334155;
}

@media (max-width: 768px) {
    .gallery-controls {
        grid-template-columns: 1fr 3fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-controls {
        grid-template-columns: 1fr;
    }
    .control-group label {
        text-align: left;
    }
}

.control-group {
    display: contents;
}

.control-group label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: right;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.control-group label i {
    margin-right: 0.4rem;
}

.form-select {
    background-color: #0f172a;
    color: #f8fafc;
    border: 1px solid #475569;
    padding: 0.4rem 0.8rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    margin: 0 !important; /* グローバルCSSのマージンを打ち消し */
}

.form-select:focus {
    border-color: #3b82f6;
}

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

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.loading-state i {
    margin-bottom: 1rem;
    color: #3b82f6;
}

/* Card Design */
.course-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border-color: #475569;
}

.card-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    cursor: pointer;
}

.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-tool-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-weight: bold;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.card-title:hover {
    color: #3b82f6;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.card-author i {
    margin-right: 0.3rem;
}

.card-date {
    font-size: 0.75rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #334155;
    padding-top: 0.8rem;
}

.btn-like {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 2rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-like:hover:not(:disabled) {
    background: #ef4444;
    color: #fff;
}

.btn-like.liked {
    background: #ef4444;
    color: #fff;
}

.btn-like:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-delete {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem;
    transition: color 0.2s;
}

.btn-delete:hover {
    color: #ef4444;
}
