/* AIE Map - Main Stylesheet */

/* Reset and base styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Header and navigation */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2rem;
}

.header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
}

.nav {
    background-color: #34495e;
    padding: 0.5rem;
    text-align: center;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    background-color: #3498db;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: #2980b9;
}

/* Container and layout */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Book badges */
.book-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.book-badge.aie {
    background-color: #FF0000;
}

.book-badge.dmls {
    background-color: #00FF00;
}

/* Review items */
.review-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    height: fit-content;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.review-meta {
    color: #7f8c8d;
    font-size: 0.75rem;
}

.reviewer-info, .review-author {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.review-text {
    margin: 0.75rem 0;
    line-height: 1.5;
    word-wrap: break-word;
    max-width: 100%;
}

.review-actions {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Links and clickable elements */
.clickable {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
}

.clickable:hover {
    text-decoration: underline;
}

.action-link {
    color: #3498db;
    text-decoration: none;
}

.action-link:hover {
    text-decoration: underline;
}

.action-link.delete {
    color: #e74c3c;
}

.action-separator {
    margin: 0 0.5rem;
    color: #7f8c8d;
}

.reviewer-link {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
}

.reviewer-link:hover {
    text-decoration: none;
    border-bottom: 1px solid #3498db;
}

/* Featured reviews (admin only) */
.featured-review {
    border: 2px solid #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3) !important;
}

.featured-badge {
    display: inline-block;
    background: #f39c12;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    text-shadow: none;
}

.featured-checkbox {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    cursor: pointer;
}

.featured-checkbox input {
    margin-right: 0.3rem;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* Forms and filters */
.filters {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filters h2 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.filter-item select, 
.filter-item input {
    padding: 0.4rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s;
}

.filter-item select:focus, 
.filter-item input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.autocomplete-item {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover, 
.autocomplete-item.selected {
    background-color: #f3f4f6;
    color: #1a202c;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.error {
    background-color: #e74c3c;
}

/* Reviews grid layout */
#reviewsList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.results-header {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Utility classes */
.no-reviews {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    grid-column: 1 / -1;
    padding: 2rem;
}

.expand-btn {
    color: #3498db;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.expand-btn:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    
    .filter-grid {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-item {
        width: 100%;
        justify-content: space-between;
    }
    
    .review-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}