:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f4f7f6;
    --text: #333;
    --light-text: #777;
    --white: #fff;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 30px;
    box-shadow: var(--shadow);
    outline: none;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
}

.filter-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover, .chip.active {
    background: var(--white);
    color: var(--primary);
}

main {
    padding: 40px 0;
}

.upload-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px dashed #ddd;
}

.upload-box h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.upload-box p {
    color: var(--light-text);
    margin-bottom: 20px;
}

#uploadStatus {
    margin-top: 15px;
    font-weight: 600;
}

#uploadStatus.error {
    color: #e74c3c;
}

#uploadStatus.success {
    color: #27ae60;
}

.results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--light-text);
}

.lang-toggle button {
    padding: 4px 12px;
    background: #e0e0e0;
    border: none;
    cursor: pointer;
}

.lang-toggle button.active {
    background: var(--accent);
    color: var(--white);
}

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

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #eee;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--light-text);
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    font-size: 0.75rem;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal-content {
    margin: 5% auto;
    background: var(--white);
    max-width: 900px;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        flex-direction: row;
        max-height: 80vh;
    }
}

.modal-content img {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    background: #000;
}

@media (min-width: 768px) {
    .modal-content img {
        width: 60%;
        max-height: none;
    }
}

.modal-details {
    padding: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-details {
        width: 40%;
    }
}

.modal-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 12px 15px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn.secondary {
    background: #7f8c8d;
}

.btn.secondary:hover {
    background: #95a5a6;
}

.btn:hover {
    background: #2980b9;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
