* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: transparent;
    color: #333;
    padding: 20px 0;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Brand area with logo + title */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    height: 48px;
    width: auto;
    display: block;
    filter: none;
}

.app-title {
    font-size: 48px;
    line-height: 48px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-upload-mode, .btn-small {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-upload-mode {
    background-color: #e74c3c;
    color: white;
}

.btn-upload-mode:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
    margin-left: 10px;
}

.upload-mode-indicator {
    background-color: #27ae60;
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

/* Class Grid */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.class-card {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.class-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.class-card .class-code {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.class-card .doc-count {
    margin-top: 10px;
    color: #3498db;
}

/* Search */
.search-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

#searchInput {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
}

.search-result {
    background: #f9f9f9;
    padding: 20px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.search-result h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.search-result .excerpt {
    color: #555;
    line-height: 1.8;
}

.search-result .relevance {
    color: #3498db;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Upload Interface */
.upload-container, .class-management {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.file-upload {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#fileInput {
    flex: 1;
    padding: 8px;
}

input[type="text"], input[type="password"], select {
    padding: 10px;
    margin: 5px 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
}

.success {
    color: #27ae60;
    margin-top: 10px;
}

/* Documents management */
.documents-list-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.documents-list-container h3 {
    margin-bottom: 15px;
    color: #333;
}

.documents-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.document-item:hover {
    background: #f0f0f0 !important;
}

.btn-delete:hover {
    background: #c0392b !important;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #c0392b;
}
