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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Authentication Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

.modal-content h2 {
    margin-bottom: 8px;
    color: #333;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.modal-content button:hover {
    background: #5568d3;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    min-height: 20px;
}

.note {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    height: calc(100vh - 80px);
}

/* Navigation */
.admin-nav {
    width: 250px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.nav-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    text-align: left;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f5f5f5;
    color: #333;
}

.nav-item.active {
    background: #667eea;
    color: white;
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.panel {
    display: none;
    max-width: 800px;
}

.panel.active {
    display: block;
}

.panel h2 {
    margin-bottom: 8px;
    color: #333;
}

.panel > p {
    color: #666;
    margin-bottom: 25px;
}

/* Info Box */
.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.info-box h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 16px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-help {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Message Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

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

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* Export Panel */
.export-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.data-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Documentation Panel */
.doc-selector-container {
    margin: 25px 0;
}

.doc-selector-container label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.doc-selector {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.doc-selector:focus {
    outline: none;
    border-color: #667eea;
}

.doc-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.doc-error {
    padding: 15px;
    background: #fee;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    color: #c0392b;
    margin: 20px 0;
}

.doc-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-top: 20px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Rendered Markdown Styles */
.doc-content h1 {
    font-size: 32px;
    margin: 24px 0 16px 0;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 12px;
}

.doc-content h1:first-child {
    margin-top: 0;
}

.doc-content h2 {
    font-size: 26px;
    margin: 24px 0 12px 0;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.doc-content h3 {
    font-size: 20px;
    margin: 20px 0 10px 0;
    color: #333;
}

.doc-content h4 {
    font-size: 16px;
    margin: 16px 0 8px 0;
    color: #333;
    font-weight: 600;
}

.doc-content h5 {
    font-size: 14px;
    margin: 12px 0 6px 0;
    color: #555;
    font-weight: 600;
}

.doc-content h6 {
    font-size: 13px;
    margin: 12px 0 6px 0;
    color: #666;
    font-weight: 600;
}

.doc-content p {
    margin: 12px 0;
    line-height: 1.6;
    color: #555;
}

.doc-content a {
    color: #667eea;
    text-decoration: none;
}

.doc-content a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.doc-content ul,
.doc-content ol {
    margin: 12px 0;
    padding-left: 30px;
}

.doc-content li {
    margin: 6px 0;
    line-height: 1.6;
    color: #555;
}

.doc-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #d63384;
}

.doc-content pre {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.doc-content pre code {
    background: transparent;
    padding: 0;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

.doc-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
    font-style: italic;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.doc-content table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    border: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
}

.doc-content table td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    color: #555;
}

.doc-content table tr:nth-child(even) {
    background: #f8f9fa;
}

.doc-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 24px 0;
}

.doc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}
