/**
 * KN Werkzeuge Plugin Styles
 * Version: 1.0.0
 */

/* ========================================
   CUSTOM SVG CHECKMARK CHECKBOXES
   ======================================== */

/* Hide native checkboxes */
.werkzeuge-selection-container input[type="checkbox"],
.werkzeuge-list input[type="checkbox"],
.werkzeug-item input[type="checkbox"],
.kn-werkzeug-item input[type="checkbox"],
.kn-checkbox-label input[type="checkbox"],
#e-government-tools input[type="checkbox"],
#kommunalnet-tools input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* Custom checkbox wrapper */
.werkzeug-item,
.kn-werkzeug-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.werkzeug-item label,
.kn-werkzeug-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 40px;
    margin: 0;
}

/* Checkbox-only label: just the box, no text - separates checkbox click from link click */
.werkzeug-item label.werkzeug-checkbox-only,
.kn-werkzeug-item label.werkzeug-checkbox-only {
    padding-left: 0;
    width: 24px;
    min-width: 24px;
    flex: 0 0 auto;
}

.werkzeug-item label.werkzeug-checkbox-only::before,
.kn-werkzeug-item label.werkzeug-checkbox-only::before {
    left: 0;
}

.werkzeug-item label.werkzeug-checkbox-only::after,
.kn-werkzeug-item label.werkzeug-checkbox-only::after {
    left: 12px;
}

/* Tool name link - separate from checkbox, clickable to open tool */
.werkzeug-item .werkzeug-anker,
.werkzeug-item .pvTicket,
.kn-werkzeug-item .werkzeug-anker,
.kn-werkzeug-item .pvTicket {
    flex: 1;
    position: static;
    width: auto;
    height: auto;
    cursor: pointer;
    display: block;
}

/* Custom checkbox box */
.werkzeug-item label::before,
.kn-werkzeug-item label::before,
.kn-checkbox-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2px solid #1f2043;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Checkbox hover state - only when not checked */
.werkzeug-item:hover:not(:has(input[type="checkbox"]:checked)) label::before,
.kn-werkzeug-item:hover:not(:has(input[type="checkbox"]:checked)) label::before,
.kn-checkbox-label:hover:not(:has(input[type="checkbox"]:checked))::before {
    border-color: #0e6354;
    background-color: #f8f9fa;
}

/* Fallback for browsers that don't support :has() */
.werkzeug-item:hover label::before,
.kn-werkzeug-item:hover label::before,
.kn-checkbox-label:hover::before {
    border-color: #0e6354;
    background-color: #f8f9fa;
}

/* Checked state - background color - MUST override hover and default */
.werkzeug-item input[type="checkbox"]:checked + label::before,
.kn-werkzeug-item input[type="checkbox"]:checked + label::before,
.kn-checkbox-label input[type="checkbox"]:checked ~ .kn-checkbox-text::before,
.kn-checkbox-label input[type="checkbox"]:checked + .kn-checkbox-text::before,
#e-government-tools input[type="checkbox"]:checked + label::before,
#kommunalnet-tools input[type="checkbox"]:checked + label::before,
.werkzeuge-selection-container input[type="checkbox"]:checked + label::before,
.werkzeuge-list input[type="checkbox"]:checked + label::before {
    background-color: #0e6354 !important;
    border-color: #0e6354 !important;
}

/* Also handle when label wraps the checkbox */
.werkzeug-item label:has(input[type="checkbox"]:checked)::before,
.kn-werkzeug-item label:has(input[type="checkbox"]:checked)::before {
    background-color: #0e6354 !important;
    border-color: #0e6354 !important;
}

/* Additional class-based selector for JavaScript-added class */
.werkzeug-item.checkbox-checked label::before,
.kn-werkzeug-item.checkbox-checked label::before,
.kn-checkbox-label.checkbox-checked::before {
    background-color: #0e6354 !important;
    border-color: #0e6354 !important;
}

/* SVG checkmark container */
.werkzeug-item label::after,
.kn-werkzeug-item label::after,
.kn-checkbox-label::after {
    content: '';
    position: absolute;
    left: 12px; /* Center of 24px checkbox box (24px / 2 = 12px) */
    top: 50%;
    transform: translate(-50%, -50%); /* Center the 16px SVG on the 12px point */
    width: 16px;
    height: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* SVG checkmark - using background image with inline SVG data URI */
.werkzeug-item input[type="checkbox"]:checked + label::after,
.kn-werkzeug-item input[type="checkbox"]:checked + label::after,
.kn-checkbox-label input[type="checkbox"]:checked ~ .kn-checkbox-text::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolyline class='checkmark-line' fill='none' stroke='%23fff' stroke-width='10' stroke-miterlimit='20' stroke-linecap='round' stroke-linejoin='round' points='15,60 40,80 85,20'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* SVG checkmark element (injected via JavaScript) - positioned to align with label's ::before checkbox box */
.werkzeug-item .werkzeug-checkmark-svg,
.kn-werkzeug-item .kn-werkzeug-checkmark-svg {
    position: absolute;
    /* left is set dynamically via JavaScript to align with label's checkbox box */
    top: 50%;
    transform: translateY(-50%); /* Center vertically */
    width: 24px; /* Match checkbox box width exactly */
    height: 24px; /* Match checkbox box height exactly */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.werkzeug-item .werkzeug-checkmark-svg svg,
.kn-werkzeug-item .kn-werkzeug-checkmark-svg svg {
    width: 16px;
    height: 16px;
    display: block;
}

.kn-checkbox-label .kn-werkzeug-checkmark-svg {
    position: absolute;
    /* left is set dynamically via JavaScript to align with checkbox box */
    top: 50%;
    transform: translateY(-50%); /* Center vertically */
    width: 24px; /* Match checkbox box width exactly */
    height: 24px; /* Match checkbox box height exactly */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.kn-checkbox-label .kn-werkzeug-checkmark-svg svg {
    width: 16px;
    height: 16px;
    display: block;
}

.werkzeug-item input[type="checkbox"]:checked ~ .werkzeug-checkmark-svg,
.kn-werkzeug-item input[type="checkbox"]:checked ~ .kn-werkzeug-checkmark-svg,
.kn-checkbox-label input[type="checkbox"]:checked ~ .kn-werkzeug-checkmark-svg {
    opacity: 1;
}

.werkzeug-checkmark-svg .checkmark-line,
.kn-werkzeug-checkmark-svg .checkmark-line {
    fill: none;
    stroke: #fff;
    stroke-width: 10;
    stroke-miterlimit: 20;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 130px 130px;
    stroke-dashoffset: 130px;
    transition: stroke-dashoffset 500ms ease-in-out;
}

.werkzeug-item input[type="checkbox"]:checked ~ .werkzeug-checkmark-svg .checkmark-line,
.kn-werkzeug-item input[type="checkbox"]:checked ~ .kn-werkzeug-checkmark-svg .checkmark-line,
.kn-checkbox-label input[type="checkbox"]:checked ~ .kn-werkzeug-checkmark-svg .checkmark-line {
    stroke-dashoffset: 0;
}

/* Fix for kn-checkbox-label structure */
.kn-checkbox-label {
    position: relative;
    padding-left: 40px;
}

.kn-checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.kn-checkbox-label::before {
    left: 0;
}

.kn-checkbox-label input[type="checkbox"]:checked ~ .kn-checkbox-text::after {
    left: 4px;
}

/* ========================================
   KN WERKZEUGE HOME STYLES
   ======================================== */

/* Main container for home page */
.kn-werkzeuge-home-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible !important;
}

/* Layout for logged-in users */
.kn-werkzeuge-home-layout {
    display: flex;
    gap: 35px;
    align-items: flex-start;
}

.kn-werkzeuge-cards-section {
    flex: 0 0 67%;
    min-width: 0;
}

.kn-werkzeuge-infobox {
    flex: 0 0 33%;
    min-width: 0;
}

/* Werkzeuge cards section - Using exact same classes as original */
.werkzeuge {
    padding: 0px !important;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.werkzeuge-content {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* Grid container for the 3x3 layout - Using exact same ID as original */
#mytools-fav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: 300px;
}

/* Individual werkzeug blocks */
.werkzeug-single-block,
.werkzeug-single-bloce {
    background-color: #0e6354;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px 12px;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Werkzeug anchor link - makes entire card clickable */
.werkzeug-anker,
.kn-werkzeug-anker {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    text-decoration: none;
    z-index: 1;
    cursor: pointer;
}

.werkzeug-anker:hover,
.kn-werkzeug-anker:hover {
    text-decoration: none;
}

/* Hover effects */
.werkzeug-single-block:hover,
.werkzeug-single-bloce:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background-color: #0a4f43;
}

/* Text styling for WERKZEUG */
.werkzeug-text-block {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

.werkzeug-text-block p {
    color: white;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    font-size: 11pt;
    line-height: 15pt;
    letter-spacing: 30;
    text-transform: none;
    margin: 0;
    text-align: left;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
    -ms-hyphens: manual;
    -moz-hyphens: manual;
    word-break: normal;
    overflow-wrap: break-word;
    display: block;
    overflow: visible;
    text-overflow: unset;
    pointer-events: none;
    /* Ensure hyphens are visible when words break */
    hyphenate-limit-chars: 6 3 2;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 2;
}

/* Close button styling */
.btn-werkzeuge-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: auto;
    text-decoration: none;
}

.btn-werkzeuge-close:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* kn-WERKZEUGE Infobox Styles - Using exact same classes as original */
.infobox-container {
    padding: 0;
    width: 100%;
    max-width: 100%;
    background-color: #ffffff;
    border-radius: 8px 8px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.infobox-header {
    background: #bdd0de;
    padding: 15px 20px;
    font-size: 20px;
    font-weight: 900;
    color: #1f2043;
    text-align: center;
    position: relative;
    border-radius: 8px 8px 0 0;
    font-family: 'Lato', sans-serif;
}

.infobox-list {
    padding: 35px;
    position: relative;
}

.infobox-item {
    display: flex;
    align-items: center;
    margin-bottom: 35px;
    position: relative;
}

.infobox-item:last-child {
    margin-bottom: 0;
}

.infobox-item img {
    width: 20px;
    height: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.infobox-text {
    font-size: 20px;
    font-weight: 400;
    color: #1f2043;
    text-decoration: none;
    word-wrap: break-word;
    font-family: 'Lato', sans-serif;
    transition: color 0.3s ease;
}

.infobox-text:hover {
    color: #1f2043;
    text-decoration: none;
    opacity: 0.8;
}

/* Responsive images for non-logged-in users */
.kn-werkzeuge-home-not-logged-in {
    width: 100%;
    overflow: visible !important;
    min-height: auto;
    max-height: none !important;
}

.kn-werkzeuge-image-container {
    position: relative;
    width: 100%;
    text-align: center;
    overflow: visible !important;
    min-height: auto;
    max-height: none !important;
}

.kn-werkzeuge-image {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.kn-werkzeuge-desktop-image {
    display: block;
}

.kn-werkzeuge-mobile-image {
    display: none;
}

/* No tools message */
.kn-no-tools-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

/* ========================================
   KN WERKZEUGE PAGE STYLES
   ======================================== */

/* Security Class Display */
.kn-security-class-display {
    text-align: right;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.kn-security-label {
    font-size: 16px;
    color: #666;
    font-family: 'Lato', sans-serif;
}

.kn-security-value {
    font-size: 16px;
    color: #27ad7a;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    margin-left: 5px;
}

/* Right Sidebar */
.kn-werkzeuge-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    padding-left: 20px;
}

.kn-sidebar-section {
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.kn-sidebar-header {
    background-color: #0e6354;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
}

.kn-sidebar-header i {
    font-size: 18px;
    margin-right: 10px;
    font-style: normal;
    font-weight: bold;
}

.kn-sidebar-header h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    font-family: 'Lato', sans-serif;
}

.kn-sidebar-content {
    padding: 20px;
}

.kn-sidebar-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 15px 0;
    font-family: 'Lato', sans-serif;
}

.kn-faq-link {
    display: inline-block;
    background-color: #27ad7a;
    color: white !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    font-family: 'Lato', sans-serif;
}

.kn-faq-link:hover {
    background-color: #1e8b63;
    color: white !important;
    text-decoration: none;
}

/* ID Austria Section */
.kn-id-austria-section .kn-sidebar-header {
    background-color: #1f2043;
}

.kn-id-austria-section .kn-sidebar-header h3 {
    color: white !important;
}

.kn-id-austria-clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.kn-id-austria-clickable:hover {
    background-color: #2a2d5a !important;
}

/* FAQ Section */
.kn-faq-section .kn-sidebar-header {
    background-color: #6c757d;
}

/* All Tools Section */
.kn-all-tools-section {
    margin-top: 40px;
    position: relative;
}

.kn-all-tools-section h2 {
    color: #1f2043;
    font-size: 2em;
    font-weight: 300;
    margin-bottom: 10px;
    font-family: 'Lato', sans-serif;
}

.kn-tools-divider {
    height: 3px;
    background-color: #27ad7a;
    margin-bottom: 30px;
    width: 100px;
}

/* Page Layout Adjustments */
.kn-werkzeuge-page-container {
    position: relative;
}

.kn-werkzeuge-content-section {
    position: relative;
    padding-right: 320px; /* Make room for sidebar */
}

/* Werkzeuge Cards Section for Page - Adjusted for sidebar */
.kn-werkzeuge-cards-section-page {
    margin-top: 20px;
    margin-bottom: 40px;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
    max-width: calc(100% - 320px); /* Adjust for sidebar */
}

/* Login Required Section */
.kn-werkzeuge-login-required {
    max-width: 100%;
    margin: 0;
    padding: 40px 20px;
}

.kn-werkzeuge-access-denied {
    background: #fff;
    border: 2px solid #27ad7a;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.kn-werkzeuge-access-denied h2 {
    color: #e74c3c;
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: bold;
}

.kn-werkzeuge-login-section,
.kn-werkzeuge-register-section {
    margin-bottom: 30px;
    text-align: left;
}

.kn-werkzeuge-login-section h3,
.kn-werkzeuge-register-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.kn-werkzeuge-login-section p,
.kn-werkzeuge-register-section p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.kn-werkzeuge-login-btn {
    background: #27ad7a;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.kn-werkzeuge-login-btn:hover {
    background: #219a6b;
}

/* Register link - same look as login btn, not intercepted by JS */
.kn-werkzeuge-register-link {
    display: inline-block;
    background: #27ad7a;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}
.kn-werkzeuge-register-link:hover {
    background: #219a6b;
    color: white !important;
}

/* Kontaktiere link (shortcode 2) - force over theme */
.kn-werkzeuge-kontakt-link,
.kn-werkzeuge-access-denied .kn-werkzeuge-kontakt-link,
a.kn-werkzeuge-kontakt-link {
    color: #27AD7A !important;
    font-family: "Lato-local", Sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 22pt !important;
}
.kn-werkzeuge-kontakt-link:hover {
    color: #27AD7A !important;
    font-weight: 400 !important;
}

/* Content Section */
.kn-werkzeuge-content-section {
    display: block;
}

/* Werkzeuge Cards Section for Page */
.kn-werkzeuge-cards-section-page {
    margin-top: 20px;
    margin-bottom: 40px;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
}

.kn-werkzeuge-cards-header {
    text-align: center;
    margin-bottom: 30px;
}

.kn-werkzeuge-cards-header h2 {
    color: #1f2043;
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-cards-header p {
    color: #666;
    font-size: 16px;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-cards-container {
    max-width: 1000px;
    margin: 0 auto;
}

.kn-werkzeuge-cards-container .kn-werkzeuge {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.kn-werkzeuge-cards-container .kn-werkzeuge-content {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* Grid container for the 3x3 layout in page */
#kn-mytools-fav-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: 300px;
}

/* Individual werkzeug blocks in page */
.kn-werkzeuge-cards-container .kn-werkzeug-single-block,
.kn-werkzeuge-cards-container .werkzeug-single-block,
.kn-werkzeuge-cards-container .werkzeug-single-bloce {
    background-color: #0e6354;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px 12px;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hover effects for page cards */
.kn-werkzeuge-cards-container .kn-werkzeug-single-block:hover,
.kn-werkzeuge-cards-container .werkzeug-single-block:hover,
.kn-werkzeuge-cards-container .werkzeug-single-bloce:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background-color: #0a4f43;
}

/* Text block styling for WERKZEUG in page */
.kn-werkzeuge-cards-container .kn-werkzeug-text-block,
.kn-werkzeuge-cards-container .werkzeug-text-block {
    padding-left: 5px;
    padding-right: 5px;
    box-sizing: border-box;
}

/* Text styling for WERKZEUG in page */
.kn-werkzeuge-cards-container .kn-werkzeug-text-block p {
    color: white;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    font-size: 11pt;
    line-height: 15pt;
    letter-spacing: 50;
    text-transform: none;
    margin: 0;
    text-align: left;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
    -ms-hyphens: manual;
    -moz-hyphens: manual;
    word-break: normal;
    overflow-wrap: break-word;
    display: block;
    max-height: none;
    overflow: visible;
    position: relative;
    /* Ensure hyphens are visible when words break */
    hyphenate-limit-chars: 6 3 2;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 2;
}

/* Close button styling for page - Force with !important to override any other styles */
.kn-werkzeuge-page-container .btn-werkzeuge-close,
.kn-werkzeuge-cards-container .kn-btn-werkzeuge-close,
.kn-werkzeuge-cards-container .btn-werkzeuge-close,
#kn-mytools-fav-page .btn-werkzeuge-close,
.kn-werkzeuge-cards-container .werkzeug-single-block .btn-werkzeuge-close,
.kn-werkzeuge-cards-container .werkzeug-single-bloce .btn-werkzeuge-close,
.kn-werkzeuge-cards-container .kn-werkzeug-single-block .btn-werkzeuge-close,
#kn-mytools-fav-page .werkzeug-single-block .btn-werkzeuge-close,
#kn-mytools-fav-page .werkzeug-single-bloce .btn-werkzeuge-close,
#kn-mytools-fav-page .kn-werkzeug-single-block .btn-werkzeuge-close,
.kn-werkzeuge-page-container .werkzeug-single-block .btn-werkzeuge-close,
.kn-werkzeuge-page-container .werkzeug-single-bloce .btn-werkzeuge-close,
.kn-werkzeuge-page-container .kn-werkzeug-single-block .btn-werkzeuge-close {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: rgb(255 255 255 / 32%) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
    pointer-events: auto !important;
    text-decoration: none !important;
}

.kn-werkzeuge-page-container .btn-werkzeuge-close:hover,
.kn-werkzeuge-cards-container .kn-btn-werkzeuge-close:hover,
.kn-werkzeuge-cards-container .btn-werkzeuge-close:hover,
#kn-mytools-fav-page .btn-werkzeuge-close:hover,
.kn-werkzeuge-cards-container .werkzeug-single-block .btn-werkzeuge-close:hover,
.kn-werkzeuge-cards-container .werkzeug-single-bloce .btn-werkzeuge-close:hover,
.kn-werkzeuge-cards-container .kn-werkzeug-single-block .btn-werkzeuge-close:hover,
#kn-mytools-fav-page .werkzeug-single-block .btn-werkzeuge-close:hover,
#kn-mytools-fav-page .werkzeug-single-bloce .btn-werkzeuge-close:hover,
#kn-mytools-fav-page .kn-werkzeug-single-block .btn-werkzeuge-close:hover,
.kn-werkzeuge-page-container .werkzeug-single-block .btn-werkzeuge-close:hover,
.kn-werkzeuge-page-container .werkzeug-single-bloce .btn-werkzeuge-close:hover,
.kn-werkzeuge-page-container .kn-werkzeug-single-block .btn-werkzeuge-close:hover {
    background-color: rgb(255 255 255 / 44%) !important;
    transform: scale(1.1) !important;
    color: #333 !important;
    text-decoration: none !important;
}

.kn-no-tools-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.kn-werkzeuge-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.kn-werkzeuge-page-header h1 {
    color: #1f2043;
    font-size: 2.5em;
    font-weight: 300;
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-warning-box {
    background-color: #fff;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.kn-werkzeuge-warning-box p {
    color: #e74c3c;
    font-size: 16px;
    margin: 0;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.kn-werkzeuge-section {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.kn-werkzeuge-section-header {
    background-color: #0e6354;
    color: white;
    padding: 20px;
    text-align: center;
}

.kn-werkzeuge-section-header h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-section-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-list {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.kn-werkzeug-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.kn-werkzeug-item:last-child {
    border-bottom: none;
}

/* Checkbox styling is now handled by custom SVG checkboxes above */

.kn-werkzeug-item label {
    flex: 1;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
}

.kn-new-badge {
    background-color: #27ad7a;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: bold;
}

.kn-werkzeuge-loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.kn-login-required {
    text-align: center;
    color: #666;
    font-size: 18px;
    padding: 40px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* ========================================
   KN WERKZEUGE SETTINGS STYLES
   ======================================== */

.kn-werkzeuge-settings-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.kn-werkzeuge-settings-header h1 {
    color: #1f2043;
    font-size: 2.5em;
    font-weight: 300;
    text-align: center;
    margin-bottom: 40px;
    font-family: 'Lato', sans-serif;
}

.kn-werkzeuge-settings-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.kn-settings-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.kn-settings-section h2 {
    color: #1f2043;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    font-family: 'Lato', sans-serif;
}

.kn-settings-section p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: 'Lato', sans-serif;
}

.kn-settings-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.kn-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Lato', sans-serif;
}

.kn-btn-primary {
    background-color: #27ad7a;
    color: white;
}

.kn-btn-primary:hover {
    background-color: #1e8b63;
}

.kn-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.kn-btn-secondary:hover {
    background-color: #545b62;
}

.kn-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kn-stat-item {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.kn-stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #27ad7a;
    margin-bottom: 10px;
    font-family: 'Lato', sans-serif;
}

.kn-stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
}

.kn-settings-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kn-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
}

/* Checkbox styling is now handled by custom SVG checkboxes above */

.kn-checkbox-text {
    font-size: 16px;
    color: #333;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .kn-werkzeuge-home-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .kn-werkzeuge-cards-section {
        flex: 1;
    }
    
    .kn-werkzeuge-infobox {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .kn-werkzeuge-home-not-logged-in {
        overflow: visible !important;
        max-height: none !important;
    }
    
    .kn-werkzeuge-image-container {
        overflow: visible !important;
        max-height: none !important;
    }
    
    .kn-werkzeuge-desktop-image {
        display: none;
    }
    
    .kn-werkzeuge-mobile-image {
        display: block;
    }
    
    .kn-werkzeuge-selection-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kn-werkzeuge-page-header h1 {
        font-size: 2em;
    }
    
    .kn-werkzeuge-section-header h2 {
        font-size: 16px;
    }
    
    /* Mobile adjustments for new layout */
    .kn-werkzeuge-content-section {
        padding-right: 0; /* Remove sidebar padding on mobile */
    }
    
    .kn-werkzeuge-sidebar {
        position: static;
        width: 100%;
        padding-left: 0;
        margin-top: 30px;
    }
    
    .kn-werkzeuge-cards-section-page {
        max-width: 100%; /* Full width on mobile */
    }
    
    .kn-security-class-display {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .kn-all-tools-section {
        margin-top: 30px;
    }
    
    .kn-all-tools-section h2 {
        font-size: 1.5em;
        text-align: center;
    }
    
    .kn-tools-divider {
        margin: 0 auto 20px auto;
    }
    
    /* Mobile styles for home page Werkzeuge cards */
    .werkzeug-text-block p {
        font-size: 10.5pt;
        line-height: 14pt;
        max-height: none;
        hyphens: manual;
        -webkit-hyphens: manual;
        -ms-hyphens: manual;
        -moz-hyphens: manual;
        word-break: normal;
        overflow-wrap: break-word;
    }
    
    .kn-werkzeug-item label {
        font-size: 14px;
    }
    
    /* Mobile styles for Werkzeuge cards section */
    .kn-werkzeuge-cards-section-page {
        margin-top: 20px;
        margin-bottom: 30px;
        padding: 20px 0;
    }
    
    .kn-werkzeuge-cards-header h2 {
        font-size: 1.5em;
    }
    
    .kn-werkzeuge-cards-header p {
        font-size: 14px;
    }
    
    #mytools-fav {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 6px;
    }
    
    #kn-mytools-fav-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .kn-werkzeuge-cards-container .kn-werkzeug-single-block,
    .kn-werkzeuge-cards-container .werkzeug-single-block,
    .kn-werkzeuge-cards-container .werkzeug-single-bloce {
        min-height: 135px;
        padding: 12px 10px;
    }
    
    .kn-werkzeuge-cards-container .kn-werkzeug-text-block p {
        font-size: 10.5pt;
        line-height: 14pt;
        hyphens: manual;
        -webkit-hyphens: manual;
        -ms-hyphens: manual;
        -moz-hyphens: manual;
        word-break: normal;
    }
    
    .infobox-container {
        margin: 0;
        max-width: none;
    }
    
    .infobox-header {
        font-size: 18px;
        padding: 12px 15px;
    }
    
    .infobox-list {
        padding: 25px;
    }
    
    .infobox-text {
        font-size: 16px;
    }
    
    .infobox-item img {
        width: 18px;
        height: 16px;
        margin-right: 12px;
    }
    
    .kn-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kn-settings-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    /* Mobile styles for home page Werkzeuge cards */
    .werkzeug-text-block p {
        font-size: 10pt;
        line-height: 13pt;
        max-height: none;
        hyphens: manual;
        -webkit-hyphens: manual;
        -ms-hyphens: manual;
        -moz-hyphens: manual;
        word-break: normal;
        overflow-wrap: break-word;
    }
    
    #mytools-fav {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 6px;
    }
    
    #kn-mytools-fav-page {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .kn-werkzeuge-cards-container .kn-werkzeug-single-block,
    .kn-werkzeuge-cards-container .werkzeug-single-block,
    .kn-werkzeuge-cards-container .werkzeug-single-bloce {
        min-height: 120px;
        padding: 10px 8px;
    }
    
    .kn-werkzeuge-cards-container .kn-werkzeug-text-block p {
        font-size: 10pt;
        line-height: 13pt;
        hyphens: manual;
        -webkit-hyphens: manual;
        -ms-hyphens: manual;
        -moz-hyphens: manual;
        word-break: normal;
    }
    
    .infobox-container {
        margin: 10px;
    }
    
    .infobox-header {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .infobox-list {
        padding: 20px;
    }
    
    .infobox-text {
        font-size: 14px;
    }
    
    .infobox-item {
        margin-bottom: 25px;
    }
    
    .infobox-item img {
        width: 16px;
        height: 14px;
        margin-right: 10px;
    }
    
    .kn-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .kn-stat-number {
        font-size: 2em;
    }
}

@media (max-width: 320px) {
    .infobox-header {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .infobox-list {
        padding: 15px;
    }
    
    .infobox-text {
        font-size: 12px;
    }
    
    .infobox-item img {
        width: 14px;
        height: 13px;
        margin-right: 8px;
    }
}

/* ========================================
   RESPONSIVE STYLES FOR MOBILE
   ======================================== */

/* Mobile styles for login required section */
@media (max-width: 768px) {
    .kn-werkzeuge-login-required {
        max-width: 95%;
        padding: 20px 15px;
        margin: 0 auto;
    }
    
    .kn-werkzeuge-access-denied {
        padding: 20px 15px;
    }
    
    .kn-werkzeuge-access-denied h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .kn-werkzeuge-login-section,
    .kn-werkzeuge-register-section {
        margin-bottom: 20px;
    }
    
    .kn-werkzeuge-login-section h3,
    .kn-werkzeuge-register-section h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .kn-werkzeuge-login-section p,
    .kn-werkzeuge-register-section p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    .kn-werkzeuge-login-btn,
    .kn-werkzeuge-register-link {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 200px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .kn-werkzeuge-login-required {
        max-width: 98%;
        padding: 15px 10px;
        margin: 0 auto;
    }
    
    .kn-werkzeuge-access-denied {
        padding: 15px 10px;
    }
    
    .kn-werkzeuge-access-denied h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .kn-werkzeuge-login-section h3,
    .kn-werkzeuge-register-section h3 {
        font-size: 15px;
    }
    
    .kn-werkzeuge-login-section p,
    .kn-werkzeuge-register-section p {
        font-size: 13px;
    }
    
    .kn-werkzeuge-login-btn,
    .kn-werkzeuge-register-link {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Very small mobile devices (320px) */
@media (max-width: 320px) {
    .kn-werkzeuge-login-required {
        max-width: 100%;
        padding: 10px 5px;
        margin: 0 auto;
    }
    
    .kn-werkzeuge-access-denied {
        padding: 10px 5px;
        border-radius: 4px;
    }
    
    .kn-werkzeuge-access-denied h2 {
        font-size: 16px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .kn-werkzeuge-login-section,
    .kn-werkzeuge-register-section {
        margin-bottom: 15px;
    }
    
    .kn-werkzeuge-login-section h3,
    .kn-werkzeuge-register-section h3 {
        font-size: 14px;
        margin-bottom: 6px;
        line-height: 1.3;
    }
    
    .kn-werkzeuge-login-section p,
    .kn-werkzeuge-register-section p {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .kn-werkzeuge-login-btn,
    .kn-werkzeuge-register-link {
        padding: 6px 12px;
        font-size: 12px;
        width: 100%;
        max-width: 150px;
        border-radius: 3px;
    }
}

/* ========================================
   SHORTCODE STYLES - OVERRIDE ELEMENTOR
   ======================================== */

/* Security Class, ID Austria, and FAQ Header Styles */
.kn-security-class-header h3,
.kn-faq-header h3,
#kn-security-class-header-value,
.kn-id-austria-header h3 {
    margin: 0 !important;
    color: #ffffff !important;
    font-family: "Lato-local", Sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 20pt !important;
    text-transform: uppercase !important;
}

/* Override Elementor styles specifically - high specificity */
.elementor-kit-20340 .kn-security-class-header h3,
.elementor-kit-20340 .kn-faq-header h3,
.elementor-kit-20340 #kn-security-class-header-value,
.elementor-kit-20340 .kn-id-austria-header h3,
body .kn-security-class-header h3,
body .kn-faq-header h3,
body #kn-security-class-header-value,
body .kn-id-austria-header h3 {
    color: #ffffff !important;
    font-family: "Lato-local", Sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 20pt !important;
    text-transform: uppercase !important;
}

/* Additional override for any Elementor kit */
[class*="elementor-kit"] .kn-security-class-header h3,
[class*="elementor-kit"] .kn-faq-header h3,
[class*="elementor-kit"] #kn-security-class-header-value,
[class*="elementor-kit"] .kn-id-austria-header h3 {
    color: #ffffff !important;
    font-family: "Lato-local", Sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 20pt !important;
    text-transform: uppercase !important;
}
