* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 30px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.toggle-btn {
    padding: 12px 32px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: #333;
}

.toggle-btn.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#selectAll {
    background: #e0e0e0;
    color: #333;
}

#selectAll:hover {
    background: #d0d0d0;
}

#exportBtn {
    background: #007bff;
    color: white;
}

#exportBtn:hover {
    background: #0056b3;
}

#exportBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Gallery View */
.gallery-container {
    display: none;
}

.gallery-container.active-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.gallery-item.selected {
    border-color: #007bff;
    background: #f0f8ff;
}

.gallery-item input[type="checkbox"] {
    margin-bottom: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gallery-item p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Presentation Decks View */
.decks-container {
    display: none;
}

.decks-container.active-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.deck-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.deck-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.deck-item.selected {
    border-color: #007bff;
    background: #f0f8ff;
}

.deck-item input[type="checkbox"] {
    margin-bottom: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.deck-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

.deck-item h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0;
}

/* Loading and Error States */
#loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

#error {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .gallery-container.active-view,
    .decks-container.active-view {
        grid-template-columns: 1fr;
    }

    .view-toggle {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 14px;
    }
}
