/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header h1 i {
    color: #667eea;
    margin-right: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ecc94b;
    color: #744210;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-icon {
    padding: 5px 10px;
    color: #667eea;
    text-decoration: none;
}

.btn-icon:hover {
    color: #5a67d8;
}

/* Actions Bar */
.actions {
    margin-bottom: 30px;
}

.action-bar {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.book-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.book-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.book-header h3 i {
    color: #667eea;
    margin-right: 8px;
}

.badge {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.book-desc {
    color: #666;
    margin-bottom: 15px;
    min-height: 40px;
}

.book-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 5px;
}

.book-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.book-footer {
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Navigation */
.nav-bar {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-bar a {
    color: #667eea;
    text-decoration: none;
}

.nav-bar span {
    color: #999;
    margin: 0 10px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table-container h3 {
    margin-bottom: 20px;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background: #f7fafc;
}

tfoot {
    background: #f7fafc;
    font-weight: bold;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.form-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-container h2 i {
    color: #667eea;
    margin-right: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* AI Examples */
.examples {
    margin: 20px 0;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.example-chips span {
    background: #edf2f7;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.example-chips span:hover {
    background: #667eea;
    color: white;
}

/* AI Confidence */
.confidence {
    background: #edf2f7;
    border-radius: 20px;
    height: 30px;
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
}

.confidence-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.confidence span {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Badges */
.badge-ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.badge-manual {
    background: #a0aec0;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Text utilities */
.text-success {
    color: #48bb78;
}

.text-danger {
    color: #f56565;
}

.text-right {
    text-align: right;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    background: #f7fafc;
    border-radius: 8px;
}

.empty-state i {
    color: #cbd5e0;
    margin-bottom: 15px;
}

.empty-state p {
    color: #718096;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
}