/* ===========================
   KOMUNIDAD DOCUMENTATION HUB
   Unified Design System
   =========================== */

:root {
    /* Modern Black & White Theme - Clean & Professional */
    --primary-color: #000000;      /* Pure black */
    --primary-hover: #1a1a1a;      /* Slightly lighter black */
    --primary-light: #f5f5f5;      /* Very light gray */
    --accent-color: #333333;       /* Dark gray for accents */
    --accent-hover: #4d4d4d;       /* Medium-dark gray */
    --accent-light: #e8e8e8;       /* Light gray */
    
    --secondary-color: #666666;    /* Medium gray */
    --secondary-hover: #4d4d4d;    /* Darker medium gray */
    
    --success-color: #000000;      /* Black for success */
    --success-light: #f0f0f0;      /* Light gray background */
    --error-color: #000000;        /* Black for errors */
    --error-light: #f5f5f5;        /* Light gray background */
    --warning-color: #333333;      /* Dark gray for warnings */
    --warning-light: #f0f0f0;      /* Light gray background */
    --info-color: #000000;         /* Black for info */
    --info-light: #f5f5f5;         /* Light gray background */
    
    --bg-primary: #FFFFFF;         /* Pure white */
    --bg-secondary: #fafafa;       /* Off-white */
    --bg-tertiary: #f5f5f5;        /* Light gray */
    
    --text-primary: #000000;       /* Black text */
    --text-secondary: #666666;     /* Medium gray text */
    --text-light: #999999;         /* Light gray text */
    
    --border-color: #e0e0e0;       /* Light gray borders */
    --border-radius: 8px;          /* Modern rounded corners */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px 0 rgba(0, 0, 0, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1400px;
    --navbar-height: 80px;
}

/* ===========================
   RESET & BASE
   =========================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: #FFFFFF;
    min-height: 100vh;
    font-size: 16px;
}

/* ===========================
   CONTAINER
   =========================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.container-sm {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    flex: 1;
    padding: 2.5rem 2rem;
    min-height: calc(100vh - var(--navbar-height) - 100px);
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ===========================
   NAVIGATION
   =========================== */

.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--navbar-height);
    padding: 0 2rem;
}

.navbar-brand {
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.brand-logo:hover {
    transform: translateY(-2px);
}

.brand-logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.navbar-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: #f8f8f8;
    color: #000000;
}

.user-greeting {
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #fafafa;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e8e8e8;
    transition: var(--transition);
}

.user-greeting:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.user-greeting strong {
    color: #000000;
    font-weight: 600;
}

.user-greeting .role-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    margin-top: 0.15rem;
}

/* Mobile Navigation */
.navbar-toggle {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
}

@media (max-width: 968px) {
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        display: none;
        margin-top: 1rem;
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .navbar-user {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .navbar-toggle {
        display: block;
    }
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    border-color: #000000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-secondary {
    background-color: white;
    color: #000000;
    border-color: #d0d0d0;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    color: #000000;
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    border-color: #d32f2f;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    border-color: #c62828;
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.3);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1.1rem 2.25rem;
    font-size: 1.05rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===========================
   CARDS
   =========================== */

.card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: #d0d0d0;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-tertiary);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: #000000;
    font-size: 0.95rem;
}

/* ===========================
   PAGE HEADER
   =========================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #000000;
    gap: 2rem;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.page-header p {
    color: #000000;
    font-size: 1.05rem;
    margin: 0;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* ===========================
   FORMS
   =========================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.help-text {
    font-size: 0.875rem;
    color: #666666;
    margin-top: 0.4rem;
    display: block;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.errorlist li {
    background: #f5f5f5;
    color: #000000;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--error-color);
}

/* ===========================
   ALERTS & MESSAGES
   =========================== */

.messages-container {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 1rem;
    z-index: 2000;
    max-width: 500px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #f5f5f5;
    color: #000000;
    border-left: 4px solid #000000;
}

.alert-error {
    background-color: #f5f5f5;
    color: #000000;
    border-left: 4px solid #000000;
}

.alert-warning {
    background-color: #f5f5f5;
    color: #000000;
    border-left: 4px solid #666666;
}

.alert-info {
    background-color: #f5f5f5;
    color: #000000;
    border-left: 4px solid #000000;
}

.alert-text {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* ===========================
   ROLE BADGES
   =========================== */

.role-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.role-developer {
    background: #000000;
    color: white;
    border: none;
}

.role-product_owner {
    background: #1a1a1a;
    color: white;
    border: none;
}

.role-sales {
    background: #333333;
    color: white;
    border: none;
}

.role-admin {
    background: #000000;
    color: white;
    border: 1px solid #333333;
}

/* Badge for notification count */
.badge {
    background: #000000;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
}

/* ===========================
   AUTHENTICATION PAGES
   =========================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #fafafa;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    max-width: 440px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 2;
}

.auth-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-logo img {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-header h4 {
    font-size: 1.25rem;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-header p {
    color: #FFFFFF;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-card .form-group {
    margin-bottom: 1rem;
}

.auth-card .form-label {
    color: #FFFFFF;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #000000;
    transition: all 0.3s ease;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="email"]:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.auth-card .btn-block {
    width: 100%;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-card .btn-block:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.auth-link {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-link p {
    font-size: 0.9rem;
    margin: 0;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-link a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ===========================
   RESPONSIVE UTILITIES
   =========================== */

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

/* ===========================
   TABLE STYLES (JIRA/Confluence-like)
   =========================== */

.document-content table,
.editor-area table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.document-content th,
.document-content td,
.editor-area th,
.editor-area td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.document-content th,
.editor-area th {
    background: #f5f5f5;
    color: #000000;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.document-content tbody tr:hover,
.editor-area tbody tr:hover {
    background: #fafafa;
}

.document-content tbody tr:nth-child(even),
.editor-area tbody tr:nth-child(even) {
    background: #fafafa;
}

.document-content tbody tr:nth-child(even):hover,
.editor-area tbody tr:nth-child(even):hover {
    background: #f5f5f5;
}

/* Code blocks */
.document-content pre,
.editor-area pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 3px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 3px solid #000000;
}

.document-content code,
.editor-area code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    color: #000000;
}

.document-content pre code,
.editor-area pre code {
    background: none;
    padding: 0;
}

.document-content :not(pre) > code,
.editor-area :not(pre) > code {
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #000000;
    border: 1px solid #e0e0e0;
}

/* Blockquotes */
.document-content blockquote,
.editor-area blockquote {
    border-left: 3px solid #000000;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #f5f5f5;
    color: #000000;
    font-style: italic;
}

/* Lists */
.document-content ul,
.document-content ol,
.editor-area ul,
.editor-area ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.document-content li,
.editor-area li {
    margin: 0.5rem 0;
}

/* Links */
.document-content a,
.editor-area a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    font-weight: 500;
}

.document-content a:hover,
.editor-area a:hover {
    border-bottom-color: #000000;
}

/* Headings in content */
.document-content h1,
.document-content h2,
.document-content h3,
.document-content h4,
.document-content h5,
.document-content h6,
.editor-area h1,
.editor-area h2,
.editor-area h3,
.editor-area h4,
.editor-area h5,
.editor-area h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #000000;
    line-height: 1.3;
}

.document-content h1,
.editor-area h1 {
    font-size: 2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.document-content h2,
.editor-area h2 {
    font-size: 1.5rem;
}

.document-content h3,
.editor-area h3 {
    font-size: 1.25rem;
}

.document-content h4,
.editor-area h4 {
    font-size: 1.1rem;
}

.document-content p,
.editor-area p {
    margin: 1rem 0;
    line-height: 1.7;
}

/* ===========================
   ACCORDION/EXPANDER
   =========================== */

.document-content .accordion-item,
.editor-area .accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

.document-content .accordion-header,
.editor-area .accordion-header {
    background: #f5f5f5;
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.document-content .accordion-header:hover,
.editor-area .accordion-header:hover {
    background: #e0e0e0;
}

.document-content .accordion-header.collapsed::after,
.editor-area .accordion-header.collapsed::after {
    transform: rotate(-90deg);
}

.document-content .accordion-content,
.editor-area .accordion-content {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.document-content .accordion-content.collapsed,
.editor-area .accordion-content.collapsed {
    display: none;
}

