/**
 * WikiTips - Style Wikipedia-like
 * Design inspiré de Wikimedia
 */

/* Variables */
:root {
    --wiki-blue: #3366cc;
    --wiki-blue-dark: #2a4b8d;
    --wiki-link: #0645ad;
    --wiki-visited: #0b0080;
    --wiki-red: #ba0000;
    --wiki-border: #a2a9b1;
    --wiki-bg: #f6f6f6;
    --wiki-bg-light: #f8f9fa;
    --wiki-text: #202122;
    --wiki-text-light: #54595d;
    --content-width: 960px;
    --sidebar-width: 200px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--wiki-text);
    background: #fff;
}

a {
    color: var(--wiki-link);
    text-decoration: none;
}

a:visited {
    color: var(--wiki-visited);
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.wiki-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.wiki-header {
    background: var(--wiki-bg-light);
    border-bottom: 1px solid var(--wiki-border);
    padding: 10px 20px;
}

.wiki-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiki-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--wiki-text);
}

.wiki-logo img {
    height: 50px;
}

.wiki-logo h1 {
    font-size: 1.5em;
    font-weight: normal;
}

.wiki-logo .subtitle {
    font-size: 0.75em;
    color: var(--wiki-text-light);
}

.wiki-search {
    display: flex;
    gap: 5px;
}

.wiki-search input {
    padding: 6px 10px;
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    width: 250px;
    font-size: 13px;
}

.wiki-search button {
    padding: 6px 12px;
    background: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    cursor: pointer;
}

.wiki-search button:hover {
    background: #eaecf0;
}

/* Navigation */
.wiki-nav {
    display: flex;
    gap: 20px;
    padding: 8px 20px;
    background: var(--wiki-bg-light);
    border-bottom: 1px solid var(--wiki-border);
    font-size: 13px;
}

.wiki-nav a {
    color: var(--wiki-link);
}

/* Sidebar */
.wiki-sidebar {
    width: var(--sidebar-width);
    padding: 20px;
    background: var(--wiki-bg-light);
    border-right: 1px solid var(--wiki-border);
    min-height: calc(100vh - 120px);
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 12px;
    font-weight: bold;
    color: var(--wiki-text-light);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--wiki-border);
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    margin: 5px 0;
}

.sidebar-section a {
    font-size: 13px;
}

/* Content */
.wiki-content {
    flex: 1;
    padding: 20px 30px;
    max-width: calc(100% - var(--sidebar-width));
}

/* Article */
.article-header {
    border-bottom: 1px solid var(--wiki-border);
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.article-header h1 {
    font-size: 1.8em;
    font-weight: normal;
    line-height: 1.3;
}

.article-meta {
    font-size: 12px;
    color: var(--wiki-text-light);
    margin-top: 5px;
}

.article-actions {
    float: right;
    font-size: 12px;
}

.article-actions a {
    margin-left: 10px;
}

/* Article sections */
.article-section {
    margin: 20px 0;
}

.article-section h2 {
    font-size: 1.4em;
    font-weight: normal;
    border-bottom: 1px solid var(--wiki-border);
    padding-bottom: 3px;
    margin-bottom: 10px;
}

.article-section h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin: 15px 0 10px;
}

.article-section h4 {
    font-size: 1em;
    font-weight: bold;
    margin: 10px 0 5px;
}

.article-section p {
    margin: 10px 0;
}

.article-section ul, .article-section ol {
    margin: 10px 0 10px 25px;
}

.article-section li {
    margin: 5px 0;
}

/* Infobox */
.infobox {
    float: right;
    width: 280px;
    margin: 0 0 20px 20px;
    border: 1px solid var(--wiki-border);
    background: var(--wiki-bg-light);
    font-size: 13px;
}

.infobox-header {
    background: var(--wiki-blue);
    color: white;
    padding: 8px 10px;
    font-weight: bold;
    text-align: center;
}

.infobox-content {
    padding: 10px;
}

.infobox-row {
    display: flex;
    border-bottom: 1px solid var(--wiki-border);
    padding: 5px 0;
}

.infobox-row:last-child {
    border-bottom: none;
}

.infobox-label {
    width: 90px;
    font-weight: bold;
    color: var(--wiki-text-light);
}

.infobox-value {
    flex: 1;
}

/* Human Rights Analysis Box */
.human-rights-box {
    background: #f8f4e8;
    border: 1px solid #c8b06b;
    border-radius: 3px;
    padding: 15px;
    margin: 20px 0;
}

.human-rights-box h3 {
    color: #6b5900;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.human-rights-analysis .analysis-section {
    margin: 15px 0;
    padding: 10px;
    background: white;
    border-radius: 3px;
}

.human-rights-analysis .analysis-section h4 {
    color: var(--wiki-blue-dark);
    margin-bottom: 8px;
}

.human-rights-analysis .concerns li {
    color: var(--wiki-red);
}

.human-rights-analysis .overall {
    background: #e8f4e8;
    border-left: 3px solid #28a745;
}

.human-rights-analysis .recommendations {
    background: #e8f0f8;
    border-left: 3px solid var(--wiki-blue);
}

/* Categories */
.article-categories {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid var(--wiki-border);
    font-size: 12px;
}

.category-tag {
    display: inline-block;
    background: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    padding: 2px 8px;
    margin: 2px;
    border-radius: 2px;
}

/* Source box */
.source-box {
    background: var(--wiki-bg-light);
    border: 1px solid var(--wiki-border);
    padding: 10px;
    margin: 15px 0;
    font-size: 12px;
}

.source-box a {
    word-break: break-all;
}

/* Article list */
.article-list {
    list-style: none;
}

.article-list-item {
    padding: 15px;
    border-bottom: 1px solid var(--wiki-border);
}

.article-list-item:hover {
    background: var(--wiki-bg-light);
}

.article-list-item h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.article-list-item .summary {
    font-size: 13px;
    color: var(--wiki-text-light);
    margin-bottom: 5px;
}

.article-list-item .meta {
    font-size: 11px;
    color: var(--wiki-text-light);
}

/* Editor */
.editor-container {
    background: var(--wiki-bg-light);
    border: 1px solid var(--wiki-border);
    padding: 20px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group textarea.large {
    min-height: 300px;
}

.form-group .help-text {
    font-size: 12px;
    color: var(--wiki-text-light);
    margin-top: 3px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    background: var(--wiki-bg);
    color: var(--wiki-text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #eaecf0;
    text-decoration: none;
}

.btn-primary {
    background: var(--wiki-blue);
    border-color: var(--wiki-blue-dark);
    color: white;
}

.btn-primary:hover {
    background: var(--wiki-blue-dark);
}

.btn-danger {
    background: #fee;
    border-color: var(--wiki-red);
    color: var(--wiki-red);
}

.btn-danger:hover {
    background: #fdd;
}

.btn-bluesky {
    background: #0085ff;
    border-color: #0066cc;
    color: white !important;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.btn-bluesky:hover {
    background: #0066cc;
    text-decoration: none;
}

.btn-bluesky:visited {
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    border-color: #128C7E;
    color: white !important;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.btn-whatsapp:hover {
    background: #128C7E;
    text-decoration: none;
}

.btn-whatsapp:visited {
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 3px;
    margin: 15px 0;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Success/Error messages */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 3px;
    margin: 15px 0;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 3px;
    margin: 15px 0;
}

/* Bluesky option in forms */
.bluesky-option {
    background: #e8f4ff;
    border: 1px solid #b8daff;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--wiki-border);
    border-top-color: var(--wiki-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-draft {
    background: #ffc107;
    color: #856404;
}

.status-published {
    background: #28a745;
    color: white;
}

/* Footer */
.wiki-footer {
    background: var(--wiki-bg-light);
    border-top: 1px solid var(--wiki-border);
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--wiki-text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-container {
        flex-direction: column;
    }

    .wiki-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--wiki-border);
    }

    .wiki-content {
        max-width: 100%;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 15px 0;
    }

    .wiki-header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .wiki-search input {
        width: 100%;
    }
}

/* Rich Text Editor */
.rich-editor-wrapper {
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    background: white;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px;
    background: var(--wiki-bg);
    border-bottom: 1px solid var(--wiki-border);
}

.rich-editor-toolbar button {
    padding: 6px 10px;
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    min-width: 32px;
}

.rich-editor-toolbar button:hover {
    background: var(--wiki-bg-light);
}

.rich-editor-toolbar button.active {
    background: var(--wiki-blue);
    color: white;
    border-color: var(--wiki-blue-dark);
}

.rich-editor-toolbar .separator {
    width: 1px;
    background: var(--wiki-border);
    margin: 0 5px;
}

.rich-editor-content {
    min-height: 150px;
    padding: 12px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.rich-editor-content:focus {
    box-shadow: inset 0 0 0 2px var(--wiki-blue);
}

.rich-editor-content p {
    margin: 0 0 10px 0;
}

.rich-editor-content p:last-child {
    margin-bottom: 0;
}

.rich-editor-content ul,
.rich-editor-content ol {
    margin: 10px 0 10px 25px;
}

/* Print */
@media print {
    .wiki-sidebar,
    .wiki-nav,
    .article-actions,
    .btn {
        display: none;
    }

    .wiki-content {
        max-width: 100%;
    }
}
