/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #34495e;
}

.btn-admin {
    background-color: #e74c3c;
}

.btn-admin:hover {
    background-color: #c0392b;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
}

.search-bar button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar button:hover {
    background-color: #27ae60;
}

/* Documents Grid */
.documents-section {
    padding: 3rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.document-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.document-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.document-info p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.document-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.document-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.document-actions {
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    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-success {
    background-color: #2ecc71;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Admin Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
}

.sidebar h2 {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 12px 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background-color: #34495e;
    border-left: 4px solid #3498db;
}

.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #f8f9fa;
}

.main-content header {
    margin-bottom: 2rem;
}

.main-content header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

table thead {
    background-color: #2c3e50;
    color: white;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table tbody tr:hover {
    background-color: #f5f7fa;
}

.actions {
    display: flex;
    gap: 5px;
}

/* Forms */
.upload-form, .login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Messages */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    color: #2c3e50;
    font-weight: bold;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #3498db, #8e44ad);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.demo-credentials {
    text-align: center;
    color: #7f8c8d;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-form button {
    padding: 10px 20px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.no-documents {
    text-align: center;
    padding: 4rem;
    color: #7f8c8d;
}

.no-documents i {
    margin-bottom: 1rem;
    color: #bdc3c7;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .document-meta {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* Login Page Specific Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.login-footer a {
    text-decoration: none;
    color: #3498db;
}

.login-footer a:hover {
    text-decoration: underline;
}

.warning-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #ffeaa7;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive login */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}