/* Globalny box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* html i body na pełny ekran */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000d2b;
    font-family: sans-serif;
    color: white;
}

/* Pasek logowania (integralny, nie fixed) */
.top-bar {
    width: 100%;
    height: 60px;
    background-color: #11172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: relative;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-right {
    display: flex;
    align-items: center;
    position: relative;
}

.top-bar-left .logo {
    height: 40px;
    margin-right: 10px;
}

/* Logo container for dynamic SVG replacement */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.logo-container .logo {
    height: 40px;
    width: auto;
    margin-right: 0;
}

.logo-container svg {
    height: 36px;
    width: 36px;
    color: white;
    stroke: currentColor;
}

.top-bar-left .system-name {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.username {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.top-bar-right .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

/* Główna treść */
.content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.content h1 {
    color: white;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
}

.content p {
    color: #ccc;
    font-size: 18px;
    line-height: 1.6;
}

/* Modules grid - horizontal layout */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.module-tile {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a2332, #2a3441);
    border: 1px solid #3a4451;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    min-height: 100px;
}

.module-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #4a5461;
}

.module-icon {
    font-size: 2.5em;
    margin-right: 20px;
    flex-shrink: 0;
}

.module-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.module-info p {
    margin: 0;
    font-size: 0.9em;
    color: #bbb;
}

/* Module specific colors */
.module-artemis:hover { border-color: #ff6b35; }
.module-hermes:hover { border-color: #4ecdc4; }
.module-chronos:hover { border-color: #45b7d1; }
.module-nox:hover { border-color: #f39c12; }
.module-suzu:hover { border-color: #e74c3c; }
.module-lux:hover { border-color: #30cfd0; }
.module-mercury:hover { border-color: #9b59b6; }
.module-placeholder { opacity: 0.6; }
.module-placeholder:hover { border-color: #666; }

/* ================= User Menu (Shared Top Bar) ================= */
.user-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 9998;
}
.username {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    pointer-events: none;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    object-fit: cover;
}
.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background-color: #1a2238;
    border: 1px solid #2a3654;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    min-width: 180px;
    z-index: 9999 !important;
    overflow: hidden;
}
.user-dropdown.show { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #2a3654;
    font-size: 13px;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background-color: #2a3654; }
.dropdown-item img {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* Module content styling */
.module-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.module-content p {
    font-size: 1.1em;
    margin-bottom: 30px;
}

.feature-placeholder {
    background: rgba(26, 35, 50, 0.7);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border-left: 4px solid #4ecdc4;
}

.feature-placeholder h3 {
    color: #4ecdc4;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.feature-placeholder ul {
    margin: 15px 0;
    padding-left: 25px;
}

.feature-placeholder li {
    margin: 12px 0;
    color: #ccc;
    font-size: 1em;
}

.admin-warning {
    background: rgba(248, 148, 6, 0.1);
    border-left: 4px solid #f89406;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.admin-warning p {
    margin: 0;
    color: #f89406;
    font-size: 0.9em;
}

/* Module content pages */
.module-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(26, 35, 50, 0.5);
    border-radius: 12px;
    border: 1px solid #3a4451;
}

.feature-placeholder {
    margin: 30px 0;
    padding: 20px;
    background: rgba(42, 52, 65, 0.5);
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
}

.feature-placeholder h3 {
    color: #4ecdc4;
    margin: 0 0 15px 0;
}

.feature-placeholder ul {
    color: #ccc;
    list-style-type: none;
    padding-left: 0;
}

.feature-placeholder li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.feature-placeholder li:before {
    content: "•";
    color: #4ecdc4;
    position: absolute;
    left: 0;
}

.admin-warning {
    margin-top: 30px;
    padding: 15px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    text-align: center;
}

.admin-warning p {
    margin: 0;
    color: #e74c3c;
}

/* ================= WIKI (SUZU) LAYOUT ================= */
.wiki-title {
    margin-bottom: 6px;
    text-align: center;
    font-size: 30px;
}
.wiki-subtitle {
    text-align: center;
    color: #8892b0;
    margin-top: 0;
    margin-bottom: 28px;
    font-size: 14px;
}
.wiki-layout {
    display: grid;
    grid-template-columns: 280px 1fr 240px;
    gap: 28px;
    align-items: stretch;
}
/* Full width content override for wiki page */
.content.wiki-full {
    max-width: 100%;
    width: 100%;
    padding-left: 40px;
    padding-right: 40px;
}
@media (max-width: 1200px) {
    .wiki-layout { grid-template-columns: 260px 1fr; }
    .wiki-toc { display: none; }
}
@media (max-width: 900px) {
    .wiki-layout { grid-template-columns: 1fr; }
    .wiki-sidebar { order: 1; }
    .wiki-main { order: 2; }
}
.wiki-sidebar {
    background: #1a2238;
    border: 1px solid #2a3654;
    border-radius: 12px;
    padding: 12px 0 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-height: 70vh;
    overflow-y: auto;
}
.wiki-search { padding: 0 20px 12px 20px; }
.wiki-search input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #2a3654;
    background: #11172a;
    color: #fff;
    font-size: 13px;
}
.wiki-file-item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, border-left-color .15s;
    border-left: 4px solid transparent;
}
.wiki-file-item:hover { background: #192134; }
.wiki-file-item.active { background: #11172a; border-left-color: #4ecdc4; }
.wiki-search-results { padding: 12px 20px; border-top: 1px solid #2a3654; }
.wiki-search-heading { font-size: 12px; color: #4ecdc4; margin-bottom: 6px; }
.wiki-search-results ul { list-style: none; padding-left: 0; margin: 0; font-size: 12px; }
.wiki-search-results li a { color: #8892b0; text-decoration: none; display: block; }
.wiki-search-results li a:hover { color: #cfd7e4; }

.wiki-main {
    background: #11172a;
    border: 1px solid #2a3654;
    padding: 32px;
    border-radius: 12px;
    min-height: 300px;
    max-height: 70vh;
    overflow-y: auto;
}
.wiki-page h1, .wiki-page h2, .wiki-page h3, .wiki-page h4 { scroll-margin-top: 80px; }
.wiki-page img { max-width: 100%; border: 1px solid #2a3654; border-radius: 8px; }

.wiki-toc {
    background: #1a2238;
    border: 1px solid #2a3654;
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    max-height: 70vh;
    overflow-y: auto;
}
.wiki-toc-heading { font-weight: 600; margin-bottom: 10px; color: #4ecdc4; }
.wiki-toc ul { list-style: none; padding-left: 0; margin: 0; }
.wiki-toc ul li a { text-decoration: none; color: #cfd7e4; display: block; padding: 2px 0; font-size: 12px; }
.wiki-toc ul li a:hover { color: #ffffff; }

/* ================= MODULE PANEL WITH ICONS ================= */
/* Enhanced module panel style with SVG icon support */
.module-panel--with-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.module-panel--with-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.module-panel__content {
    flex: 1;
    z-index: 2;
}

.module-panel__content h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.module-panel__content p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
    color: #bbb;
}

.module-panel__icon {
    width: 64px;
    height: 64px;
    z-index: 2;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.module-panel__icon img,
.module-panel__icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    stroke: currentColor;
    color: rgba(255, 255, 255, 0.85);
}

.module-panel--with-icon:hover .module-panel__icon {
    transform: scale(1.1) rotate(5deg);
}

/* Module header icon (in navbar/page header) */
.module-header-icon {
    height: 36px;
    width: 36px;
    margin-right: 12px;
    color: white;
    stroke: currentColor;
}

/* Icon loading state */
.module-panel__icon--loading {
    opacity: 0.3;
}

.module-panel__icon--loaded {
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
