/**
 * Kalendarz Brań - Main Stylesheet
 * Version: 1.0.0
 */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Kolory */
    --color-bg: #ffffff;
    --color-bg-secondary: #ffffff;
    --color-header: #ffffff;
    --color-footer: #2c4a28;
    --color-card: #ffffff;
    --color-card-hover: #f8f9fa;
    --color-primary: #10b981;
    --color-primary-dark: #059669;
    --color-accent: #3b82f6;
    --color-text: #ffffff;
    --color-text-dark: #1a1a1a;
    --color-text-secondary: #64748b;
    --color-border: #e5e7eb;
    
    --header-height: 70px;
    --sidebar-width-desktop: 30%;
    --sidebar-width-mobile: 80%;
    
    --transition-speed: 0.3s;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing system - Verdent.ai style */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-dark);
    background: #f8faf9;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

.kb-footer {
    margin-top: 0 !important;
}

/* Statyczne tło - jednolite zielone */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgba(154, 182, 145, 0.12);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ===== HEADER (STICKY) ===== */
.kb-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: #05070A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: none;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.kb-header::before {
    display: none;
}

.kb-stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.kb-star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: kb-twinkle 3s infinite ease-in-out;
}

@keyframes kb-twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.kb-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 1rem;
}

/* Logo - teraz po lewej */
.kb-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    transition: opacity var(--transition-speed);
    order: 1;
    margin: 0;
    padding: 0;
}

.kb-logo:hover {
    opacity: 0.8;
}

.kb-logo svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: #ffffff;
}

.kb-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Hamburger menu button - teraz po prawej */
.kb-menu-toggle {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    order: 2;
    flex-shrink: 0;
}

.kb-menu-toggle:hover {
    opacity: 0.7;
}

.kb-menu-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
}

/* Hamburger pozostaje hamburgerem - bez zmiany na X */

/* ===== SIDEBAR (SLIDE-IN MENU) ===== */
.kb-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: var(--sidebar-width-desktop);
    background: #05070A;
    z-index: 1100;
    transform: translateX(100%);
    transition: transform var(--transition-speed) var(--transition-easing);
    -webkit-tap-highlight-color: transparent;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: hidden;
    border-left: none;
    display: flex;
    flex-direction: column;
}

.kb-sidebar.active {
    transform: translateX(0);
}

/* Sidebar header */
.kb-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem;
    border-bottom: none;
    background: #05070A;
    position: relative;
    overflow: hidden;
    z-index: 10;
    flex-shrink: 0;
}

.kb-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.kb-sidebar-logo svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #ffffff;
}

.kb-sidebar-logo span {
    color: #ffffff;
    font-size: 16px;
}

.kb-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.kb-sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.kb-sidebar-close:hover {
    color: rgba(255,255,255,0.7);
}

/* Sidebar menu */
.kb-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
    position: relative;
    z-index: 1;
    background: #242E20;
}

.kb-sidebar-menu {
    list-style: none;
    padding: var(--space-md) 0;
}

.kb-sidebar-menu li {
    margin: 0;
}

.kb-sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--space-sm) 1rem;
    margin-left: 0;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.kb-sidebar-menu a:hover,
.kb-sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    border-left-color: #ffffff;
    color: #ffffff;
}

.kb-sidebar-menu a svg,
.kb-sidebar-menu a .icon {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

/* Menu icons */
.kb-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.kb-menu-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Auto icons for WordPress menu links */
.kb-sidebar-menu a[href*="o-stronie"]::before,
.kb-sidebar-menu a[href*="o-aplikacji"]::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    /* Margin handled by flex gap in parent link */
    background-color: currentColor;
    -webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cline x1=%2212%22 y1=%2216%22 x2=%2212%22 y2=%2212%22/%3E%3Cline x1=%2212%22 y1=%228%22 x2=%2212.01%22 y2=%228%22/%3E%3C/svg%3E');
    mask-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cline x1=%2212%22 y1=%2216%22 x2=%2212%22 y2=%2212%22/%3E%3Cline x1=%2212%22 y1=%228%22 x2=%2212.01%22 y2=%228%22/%3E%3C/svg%3E');
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}

.kb-menu-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* PRO badge */
.kb-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

/* User section in sidebar - minimalist */
.kb-user-section {
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
}

/* Minimalist user row */
.kb-user-minimal {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-left: 3px solid transparent;
    flex-wrap: nowrap;
}

.kb-user-minimal .kb-user-name {
    font-size: 16px;
    font-weight: 500;
    color: #3d5a3d;
    white-space: nowrap;
}

.kb-user-minimal > svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #3d5a3d;
}

.kb-minimal-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text-dark);
    padding: var(--space-sm) 1rem;
    border-radius: 0;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.kb-minimal-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Zaloguj = ciśnienie (zielony) */
.kb-minimal-link.kb-login-btn {
    color: #16a34a;
    border-color: #16a34a;
}
.kb-minimal-link.kb-login-btn svg {
    stroke: #16a34a;
}
.kb-minimal-link.kb-login-btn:hover {
    background: #f8fafc;
}

/* Ustawienia / konto (zielony motyw) */
.kb-minimal-link.kb-settings-btn {
    color: #3d5a3d;
}
.kb-minimal-link.kb-settings-btn svg {
    stroke: #3d5a3d;
}
.kb-minimal-link.kb-settings-btn:hover {
    border-left-color: #3d5a3d;
    background: rgba(61, 90, 61, 0.05);
}

/* Zarejestruj = wiatr (niebieski) */
.kb-minimal-link.kb-register-btn {
    color: #0891b2;
    border-color: #0891b2;
}
.kb-minimal-link.kb-register-btn svg {
    stroke: #0891b2;
}
.kb-minimal-link.kb-register-btn:hover {
    background: #f8fafc;
}

/* Wyloguj */
.kb-minimal-link.kb-logout {
    color: #dc2626;
}
.kb-minimal-link.kb-logout svg {
    stroke: #dc2626;
}
.kb-minimal-link.kb-logout:hover {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

/* Banner area in sidebar - managed by KB Banery plugin */

/* Overlay (backdrop) */
.kb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) var(--transition-easing), visibility 0s var(--transition-speed);
}

.kb-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-speed) var(--transition-easing), visibility 0s;
}

/* ===== MAIN CONTENT ===== */
.kb-main {
    padding: 0;
    margin-bottom: 0 !important;
}

.kb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.kb-full-width .kb-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.kb-full-width-padded .kb-container {
    max-width: 100%;
    margin: 0;
    padding: 0 1rem;
}

/* WordPress content styling */
.kb-main iframe,
.kb-main .wp-block-html {
    margin-bottom: var(--space-lg);
}

.kb-main iframe:last-child,
.kb-main .wp-block-html:last-child,
.kb-main .kb-container > *:last-child {
    margin-bottom: 0;
}

.home .kb-container {
    padding-bottom: 0;
}

.home .kb-main {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.home .kb-container > *:last-child,
.home .kb-container > *:last-child > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.home .wp-block-group,
.home .wp-block-columns,
.home .wp-block-html,
.home figure,
.home p:last-child {
    margin-bottom: 0;
}

/* ===== FOOTER ===== */
.kb-footer {
    background: #05070A;
    color: var(--color-text);
    padding: 2rem 0 1rem;
    position: relative;
    overflow: hidden;
}

.kb-stars-fade {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 50%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 50%);
}

.kb-footer-container {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0;
    padding: 0 1rem;
}

.kb-footer-columns {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.kb-footer-column h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.kb-footer-column h4 .kb-footer-col-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}
.kb-footer-column h4 .kb-footer-col-icon svg {
    display: block;
}

.kb-footer-column ul {
    list-style: none;
}

.kb-footer-column ul li {
    margin-bottom: 0.75rem;
}

.kb-footer-column a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-speed);
}

.kb-footer-column a:hover {
    color: var(--color-text);
}

.kb-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --sidebar-width-mobile: 80%;
    }

    .kb-header-inner {
        padding: 0 1rem;
    }

    .kb-sidebar {
        width: 100%;
        border-left: none;
    }
    
    .kb-sidebar-header {
        padding: 0 1rem;
    }
    
    .kb-sidebar-header h3 {
        font-size: 16px;
    }

    .kb-logo {
        font-size: 16px;
    }
    
    .kb-logo svg {
        width: 20px;
        height: 20px;
    }
    
    .kb-container {
        padding: 2rem 1rem;
    }

    .kb-full-width .kb-container {
        padding: 0;
    }

    .kb-full-width-padded .kb-container {
        padding: 0 1rem;
    }

    .kb-footer-columns {
        flex-direction: column;
        gap: 2rem;
    }
    
    .kb-footer-container {
        padding: 0 1rem;
    }
}

@media (min-width: 769px) {
    .kb-sidebar {
        width: var(--sidebar-width-desktop);
    }
}

/* ===== TRANSPARENT HEADER & FOOTER ===== */
.kb-header.kb-transparent {
    background: transparent;
    box-shadow: none;
}

.kb-header.kb-transparent .kb-logo,
.kb-header.kb-transparent .kb-menu-toggle span {
    color: #ffffff;
    background: #ffffff; /* dla hamburger menu */
}

.kb-header.kb-transparent .kb-logo svg {
    stroke: #ffffff;
}

.kb-footer.kb-transparent {
    background: transparent;
    color: var(--color-text-dark);
}

.kb-footer.kb-transparent .kb-footer-column h4 {
    color: var(--color-text-dark);
}

.kb-footer.kb-transparent .kb-footer-column a {
    color: var(--color-text-secondary);
}

.kb-footer.kb-transparent .kb-footer-column a:hover {
    color: var(--color-text-dark);
}

.kb-footer.kb-transparent .kb-footer-bottom {
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* Entry title styling */
.entry-header {
    margin-bottom: var(--space-xl);
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.2;
    margin: 0;
}

.entry-content {
    line-height: 1.8;
}

@media (max-width: 768px) {
    .entry-title {
        font-size: 2rem;
    }
}

/* ===== AUTH FORMS ===== */
.kb-auth-form-wrapper {
    max-width: 480px;
    margin: 0 auto;
}

.kb-auth-form {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 2px solid #d4e7cf;
}

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

.kb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #3d5a3d;
    margin-bottom: 0.5rem;
}

.kb-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #d4e7cf;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.kb-input:focus {
    outline: none;
    border-color: #3d5a3d;
    box-shadow: 0 0 0 3px rgba(61, 90, 61, 0.1);
}

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

.kb-form-group.kb-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

.kb-form-group.kb-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.kb-form-group.kb-terms-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 0;
    color: #64748b;
    font-size: 13px;
}

.kb-form-group.kb-terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.kb-form-group.kb-terms-checkbox a {
    color: #3d5a3d;
    text-decoration: underline;
    font-weight: 600;
}

.kb-form-group.kb-terms-checkbox a:hover {
    color: #2c4a28;
}

.kb-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.kb-btn-primary {
    background: #3d5a3d;
    color: #ffffff;
}

.kb-btn-primary:hover {
    background: #2c4a28;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 90, 61, 0.3);
}

.kb-form-terms {
    margin: 1.5rem 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 3px solid #3d5a3d;
    border-radius: 4px;
}

.kb-form-terms p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.kb-form-terms a {
    color: #3d5a3d;
    text-decoration: underline;
    font-weight: 600;
}

.kb-form-terms a:hover {
    color: #2c4a28;
}

.kb-form-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d4e7cf;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.kb-form-footer a {
    color: #3d5a3d;
    text-decoration: none;
    font-weight: 600;
}

.kb-form-footer a:hover {
    color: #2c4a28;
    text-decoration: underline;
}

.kb-form-footer .kb-divider {
    margin: 0 8px;
    color: #d4e7cf;
}

.kb-form-notice {
    background: #d4e7cf;
    border: 2px solid #3d5a3d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
}

.kb-form-notice p {
    font-size: 13px;
    color: #2c4a28;
    margin: 0;
    line-height: 1.5;
}

.kb-message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 14px;
    line-height: 1.5;
}

.kb-message p {
    margin: 0;
}

.kb-message.kb-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.kb-message.kb-success {
    background: #d4e7cf;
    border: 2px solid #3d5a3d;
    color: #2c4a28;
}

.kb-message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .kb-auth-form {
        padding: 2rem 1.5rem;
    }
}
