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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #EBEDFF 0%, #EBEDFF 10%, #ffffff 70%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 220px;
    background-image: url('image/radial_image_login_top_left.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: -20px;
    right: 0;
    width: 240px;
    height: 240px;
    background-image: url('image/radial_image_login_top_right.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

header {
    background-color: #ffffff;
    background-image:
        radial-gradient(circle at top left, #C5E67380 0%, transparent 20%),
        radial-gradient(circle at center center, #3C4BFB4D 0%, transparent 20%),
        radial-gradient(circle at top right, #D4B9FB80 0%, transparent 50%);
    padding: 1rem 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    margin-top: 4px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #3C4BFB;
}

.get-started-btn {
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(60, 75, 251, 0.3);
}

.get-started-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 75, 251, 0.4);
}

h1 {
    font-size: 1.25rem;
    margin-bottom: 0;
    color: #2c3e50;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}

.error {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.book-card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover.no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.book-info {
    padding: 0.75rem;
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    font-size: 0.8rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-meta {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    header {
        padding: 1.25rem 1rem;
    }

    .header-logo {
        width: 72px;
        height: 72px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .book-title {
        font-size: 1rem;
    }

    .book-author {
        font-size: 0.85rem;
    }
}

/* Desktop screens */
@media (min-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2rem;
    }
}

/* Footer styles */
.app-footer {
    background-color: #ffffff;
    background-image:
        radial-gradient(circle at top left, #3C4BFB4D 0%, transparent 30%),
        radial-gradient(circle at top right, #C5E67380 0%, transparent 50%),
        radial-gradient(circle at bottom left, #D4B9FB80 0%, transparent 50%);
    color: #333;
    padding: 2rem 1rem;
    margin-top: 1rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.app-store-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.store-link {
    display: inline-block;
    transition: transform 0.2s;
}

.store-link:hover {
    transform: scale(1.05);
}

.store-badge {
    height: 50px;
    width: auto;
}

@media (min-width: 768px) {
    .footer-text {
        font-size: 1.4rem;
    }

    .store-badge {
        height: 60px;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    background-image: radial-gradient(circle at center, #C5E67380 0%, transparent 40%, transparent 100%),
                      radial-gradient(circle at center, #3C4BFB4D 0%, transparent 50%),
                      radial-gradient(circle at center, #D4B9FB80 0%, transparent 60%);
    position: relative;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    color: #666;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    text-align: center;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.modal-features li {
    padding: 0.75rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-features li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: #3C4BFB;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-store-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
}

.modal-store-link {
    display: inline-block;
    transition: transform 0.2s;
}

.modal-store-link:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .modal-content {
        padding: 3rem 2.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-features li {
        font-size: 1.1rem;
    }
}

/* Snackbar */
.snackbar {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 10001;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.snackbar.show {
    visibility: visible;
    animation: fadein 0.3s, fadeout 0.3s 2.7s;
}

@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}
