/* Universal Books Automator Pro - Frontend Styles */

/* ===== SEARCH INTERFACE ===== */
.books-search-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.books-search-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #4CAF50;
}

.books-search-header h2 {
    font-size: 2.2em;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.books-search-header p {
    font-size: 1.1em;
    color: #7f8c8d;
    margin: 0;
}

.books-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field.full-width {
    grid-column: 1 / -1;
}

.search-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
    font-size: 0.95em;
}

.search-field input[type="text"],
.search-field select,
.search-field textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-field input[type="text"]:focus,
.search-field select:focus,
.search-field textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== SEARCH RESULTS ===== */
.books-search-results {
    margin-top: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.results-count {
    font-size: 1.2em;
    color: #2c3e50;
    font-weight: 600;
}

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

.book-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #4CAF50;
}

.book-cover-container {
    position: relative;
    padding-top: 150%;
    background: #f5f5f5;
    overflow: hidden;
}

.book-cover-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.book-source-badge.google {
    background: #4285F4;
}

.book-source-badge.apple {
    background: #000;
}

.book-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: #7f8c8d;
    font-size: 0.9em;
    margin: 0 0 10px 0;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    font-size: 0.9em;
}

.stars {
    color: #f39c12;
}

.rating-count {
    color: #95a5a6;
    font-size: 0.85em;
}

.book-meta {
    font-size: 0.85em;
    color: #95a5a6;
    margin: 8px 0;
}

.book-description {
    font-size: 0.9em;
    color: #7f8c8d;
    line-height: 1.5;
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.book-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.btn-import {
    width: 100%;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-import:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-import:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.btn-import.importing {
    background: #3498db;
}

.btn-import.imported {
    background: #27ae60;
}

/* ===== LOADING STATE ===== */
.search-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading p {
    font-size: 1.1em;
    color: #7f8c8d;
}

/* ===== ALERT MESSAGES ===== */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .books-search-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .books-search-header h2 {
        font-size: 1.8em;
    }
    
    .search-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-header {
        grid-template-columns: 1fr;
    }
}

/* ===== SINGLE BOOK PAGE (from original) ===== */
.single-book-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.book-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.book-cover-large {
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.book-header-info h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin: 0 0 15px 0;
}

.book-content {
    line-height: 1.8;
    color: #444;
}

.book-content h2 {
    color: #4CAF50;
    font-size: 1.8em;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.amazon-button-container {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 25px;
    margin: 40px 0;
    border-radius: 8px;
    text-align: center;
}

.amazon-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff9900 0%, #ff7700 100%);
    color: white !important;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
    transition: all 0.3s ease;
}

.amazon-button:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ff5500 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.5);
}
