/* General Styles */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #2c3e50;
}

/* Loading Spinner */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: #6c5ce7;
    border-radius: 50%;
    display: none;
    margin: 2rem auto;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background-color: #ff7675;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-results {
    text-align: center;
    color: #636e72;
    font-size: 1.2rem;
    margin: 2rem auto;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #6c5ce7, #a363d9);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

header h1 {
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* Improved Search Container */
#search-container {
    max-width: 600px;
    margin: 1.5rem auto 0;
    display: flex;
    gap: 10px;
    position: relative;
}

#searchInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

#searchBtn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #00b894, #00d1a0);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,184,148,0.4);
}

/* Search Results */
#searchResults {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.result-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #6c5ce7, #a363d9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.result-item:hover::before {
    opacity: 1;
}

.result-item img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.result-item h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: #2d3436;
}

.result-item p {
    margin: 0;
    color: #636e72;
    font-size: 0.9rem;
}

/* Book Details */
#bookDetails {
    max-width: 1000px;
    margin: 2rem auto;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 25px rgba(0,0,0,0.1);
}

.book-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

#bookCover {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

#bookCover:hover {
    transform: scale(1.02);
}

#bookInfo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#bookTitle {
    margin: 0;
    color: #2d3436;
    font-size: 1.8rem;
}

#bookAuthors {
    color: #636e72;
    font-size: 1.1rem;
    margin: 0;
}

#bookDescription {
    line-height: 1.6;
    color: #2d3436;
}

.download-button {
    display: inline-block;
    background: linear-gradient(135deg, #00b894, #00d1a0);
    color: white;
    text-decoration: none;
    padding: 1.2rem 2.5rem;
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,184,148,0.3);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,184,148,0.4);
}

#backBtn {
    background: linear-gradient(135deg, #6c5ce7, #a363d9);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}

#backBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,92,231,0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .book-content {
        grid-template-columns: 1fr;
    }
    
    #bookCover {
        max-width: 200px;
        margin: 0 auto;
    }
    
    #searchResults {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        padding: 1rem;
        gap: 1rem;
    }
} 