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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

header {
    background: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 30px;
}

.header-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 1.1em;
    color: #7f8c8d;
    font-style: italic;
}

.last-update {
    font-size: 0.9em;
    color: #95a5a6;
    margin: 10px 0 15px 0;
    font-style: italic;
}

.posts-count {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
}

.search-container {
    margin: 20px 0;
    text-align: center;
}

.search-box {
    width: 100%;
    max-width: 500px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box:focus {
    border-color: #3498db;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.post-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    transition: transform 0.3s;
    border-left: 5px solid #ddd;
    box-shadow: none !important;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: none !important;
}

.post-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.post-author {
    font-weight: bold;
    color: #3498db;
}

.post-date {
    font-style: italic;
}

.post-summary {
    color: #555;
    margin-bottom: 15px;
    font-style: italic;
}

.file-size {
    font-size: 0.9em;
    color: #666;
    font-family: monospace;
    margin-top: 10px;
}

.post-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    border: 1px solid #bdc3c7;
}

.add-to-library-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    margin: 15px auto 0 auto;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-library-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.highlight {
    background-color: yellow;
    color: #333;
    font-weight: bold;
    padding: 1px 2px;
    border-radius: 2px;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.footer-text {
    color: #7f8c8d;
    font-style: italic;
}

/* Popup Modal Styles */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.popup-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
}

.popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background-color: #f1f1f1;
    color: #666;
}

.popup-body {
    padding: 20px 25px;
}

.popup-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.qr-section {
    margin-bottom: 20px;
    text-align: center;
}

.qr-container {
    display: inline-block;
    margin: 10px 0;
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lid-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease;
    cursor: text;
}

.lid-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.lid-textarea:hover {
    border-color: #bbb;
}

.popup-note {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 25px 20px;
    border-top: 1px solid #eee;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.btn-secondary:hover {
    background: #d5dbdb;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .header-title {
        font-size: 2em;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .popup-content {
        width: 95%;
        margin: 20px;
    }
    
    .popup-header {
        padding: 15px 20px 10px;
    }
    
    .popup-body {
        padding: 15px 20px;
    }
    
    .popup-footer {
        padding: 10px 20px 15px;
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        color: #e0e0e0;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d3436 100%);
    }
    
    header {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .header-title {
        color: #f0f0f0;
    }
    
    .last-update {
        color: #a0a0a0;
    }
    
    .search-box {
        background: #3c3c3c;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .search-box:focus {
        border-color: #4a90e2;
    }
    
    .search-box::placeholder {
        color: #aaa;
    }
    
    .post-card {
        background: #2c2c2c;
        border-left-color: #555;
        box-shadow: none !important;
    }
    
    .post-title {
        color: #f0f0f0;
    }
    
    .post-author {
        color: #4a90e2;
    }
    
    .post-date {
        color: #a0a0a0;
    }
    
    .post-summary {
        color: #c0c0c0;
    }
    
    .file-size {
        color: #a0a0a0;
    }
    
    .tag {
        background: #3c3c3c;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .highlight {
        background-color: #ffa500;
        color: #000;
    }
    
    footer {
        background: #2c2c2c;
    }
    
    .footer-text {
        color: #a0a0a0;
    }
    
    .popup-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .popup-content {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .popup-header {
        border-bottom-color: #444;
    }
    
    .popup-header h3 {
        color: #f0f0f0;
    }
    
    .popup-close {
        color: #aaa;
    }
    
    .popup-close:hover {
        background-color: #444;
        color: #fff;
    }
    
    .popup-footer {
        border-top-color: #444;
    }
    
    .btn-secondary {
        background: #3c3c3c;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .btn-secondary:hover {
        background: #4c4c4c;
    }
    
    .qr-container {
        background: #3c3c3c;
        border-color: #555;
    }
}

/* FORCE REMOVE ALL SHADOWS FROM CARDS */
.post-card,
.post-card:hover,
.post-card:focus,
.post-card:active,
article.post-card,
article.post-card:hover,
article.post-card:focus,
article.post-card:active {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}