body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #333; /* Fallback */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
    overflow: hidden; /* Prevent scrollbars from blur edges */
}

#background-blur {
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px; /* Slight overscan to hide blur edges */
    z-index: -1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(20px) brightness(0.6);
    transition: background-image 0.5s ease-in-out;
}

.container {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9); /* More transparent */
    backdrop-filter: blur(10px); /* Glassmorphism */
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo-text {
    font-family: 'Fredoka One', cursive;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 3.5rem;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.1);
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.bug-word {
    font-family: 'Creepster', cursive;
    color: #e67e22; /* Bug orange */
    display: inline-block;
    position: relative;
    animation: wiggle 3s ease-in-out infinite;
    text-shadow: 2px 2px 0px #d35400;
}

/* Antennae */
.bug-word::before, .bug-word::after {
    content: '';
    position: absolute;
    top: -15px;
    width: 3px;
    height: 15px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.bug-word::before {
    left: 10px;
    transform: rotate(-30deg);
}

.bug-word::after {
    right: 10px;
    transform: rotate(30deg);
}

/* Little ball at tip of antenna */
.bug-word:hover::before {
    transform: rotate(-45deg) scale(1.1);
}
.bug-word:hover::after {
    transform: rotate(45deg) scale(1.1);
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.image-container {
    width: 100%;
    height: 400px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#bug-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

#bug-name {
    font-family: 'Rubik Bubbles', cursive;
    font-size: 3.5rem;
    color: #e67e22;
    margin: 0 0 2rem 0;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    letter-spacing: 2px;
    min-height: 4.5rem; /* Reserve space so layout doesn't jump */
    opacity: 0; /* Hidden by default until revealed */
}

/* Reveal Animations */
.reveal-pop {
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.reveal-fade {
    animation: fadeIn 0.8s ease-in forwards;
}

.reveal-slide {
    animation: slideUp 0.6s ease-out forwards;
}

.reveal-blur {
    animation: blurIn 0.8s ease-out forwards;
}

.reveal-bounce {
    animation: bounceDown 0.8s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes blurIn {
    0% { filter: blur(20px); opacity: 0; }
    100% { filter: blur(0); opacity: 1; }
}

@keyframes bounceDown {
    0% { transform: translateY(-50px); opacity: 0; }
    50% { transform: translateY(10px); }
    100% { transform: translateY(0); opacity: 1; }
}

button {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #219150;
}

button:active {
    transform: scale(0.98);
}

/* Button Group for snapshot and next buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

#snapshot-btn {
    background-color: #3498db;
}

#snapshot-btn:hover {
    background-color: #2980b9;
}

#snapshot-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

#report-link {
    display: inline-block;
    margin-top: 15px;
    color: #e67e22;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, transform 0.1s;
    opacity: 0.8;
}

#report-link:hover {
    color: #d35400;
    text-decoration: underline;
    opacity: 1;
}

#report-link.disabled {
    color: #95a5a6;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

/* Wallet Sidebar */
#wallet-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(34, 139, 34, 0.95) 0%, rgba(25, 100, 25, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 20px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

#wallet-sidebar.collapsed {
    transform: translateX(-280px);
}

#wallet-toggle {
    position: fixed;
    left: 280px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 50px;
    background: rgba(20, 80, 20, 0.95);
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: left 0.3s ease-in-out, background-color 0.2s;
    z-index: 101;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#wallet-toggle:hover {
    background: rgba(25, 100, 25, 0.95);
}

#wallet-sidebar.collapsed ~ #wallet-toggle {
    left: 0;
}

#wallet-sidebar h3 {
    color: #ecf0f1;
    font-family: 'Fredoka One', cursive;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.wallet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    position: relative;
}

.wallet-header h3 {
    margin: 0;
}

#download-all-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ecf0f1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#download-all-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

#download-all-btn:active {
    transform: scale(0.95);
}

#download-all-btn:disabled {
    background: rgba(127, 140, 141, 0.2);
    color: rgba(236, 240, 241, 0.4);
    cursor: not-allowed;
    transform: scale(1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#wallet-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.wallet-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    height: 110px;
}

.wallet-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
}

.wallet-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wallet-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    padding: 0;
}

.wallet-download-btn {
    position: absolute;
    top: 5px;
    right: 35px;
    width: 25px;
    height: 25px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    padding: 0;
}

.wallet-item:hover .wallet-delete-btn,
.wallet-item:hover .wallet-download-btn {
    opacity: 1;
}

.wallet-delete-btn:hover {
    background: rgba(192, 57, 43, 1);
}

.wallet-download-btn:hover {
    background: rgba(41, 128, 185, 1);
}

#wallet-counter {
    text-align: center;
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-top: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-weight: bold;
}

/* Modal for Enlarged View */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: 10px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: #e74c3c;
}

#enlarged-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-actions button {
    padding: 12px 30px;
    font-size: 1.1rem;
}

#modal-download-btn {
    background-color: #27ae60;
}

#modal-download-btn:hover {
    background-color: #219150;
}

#modal-delete-btn {
    background-color: #e74c3c;
}

#modal-delete-btn:hover {
    background-color: #c0392b;
}

/* Report Modal Specific Styles */
#report-modal .modal-content {
    max-width: 700px;
}

.report-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.report-preview {
    width: 100%;
    max-height: 300px;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#report-image-preview {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.report-info {
    text-align: left;
    color: #2c3e50;
}

.report-info p {
    margin: 10px 0;
    line-height: 1.6;
}

#report-url {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: monospace;
    background: #f9f9f9;
    margin-top: 5px;
}

#copy-url-btn {
    background-color: #95a5a6;
}

#copy-url-btn:hover {
    background-color: #7f8c8d;
}

#report-to-flickr-btn {
    background-color: #e67e22;
}

#report-to-flickr-btn:hover {
    background-color: #d35400;
}

#report-modal-close-btn {
    background-color: #34495e;
}

#report-modal-close-btn:hover {
    background-color: #2c3e50;
}

/* Adjust main container to account for wallet */
body {
    padding-left: 280px;
    transition: padding-left 0.3s ease-in-out;
}

body.wallet-collapsed {
    padding-left: 0;
}

@media (max-width: 768px) {
    body {
        padding-left: 0;
    }
    
    #wallet-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    #wallet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
