/* Problem melden Button */
.github-issue-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: #dc3545;
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    z-index: 9998;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    max-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.github-issue-btn:hover {
    background-color: #c82333;
    transform: translateY(-50%) translateX(-5px);
}

/* Modal Styling */
.github-issue-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.github-issue-modal-content {
    background-color: #fff;
    margin: 2% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 88rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.github-issue-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.github-issue-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.github-issue-close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.github-issue-close-modal:hover {
    color: #333;
}

.github-issue-modal-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .github-issue-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Formular Styling */
.github-issue-form-section h3,
.github-issue-screenshot-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.github-issue-field {
    margin-bottom: 20px;
}

.github-issue-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.github-issue-field input,
.github-issue-field select,
.github-issue-field textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.github-issue-field input:focus,
.github-issue-field select:focus,
.github-issue-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.github-issue-field textarea {
    resize: vertical;
    min-height: 80px;
}

.github-issue-submit {
    background-color: #007cba;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.github-issue-submit:hover {
    background-color: #005a87;
}

.github-issue-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Screenshot Bereich */
.github-issue-screenshot-section {
    display: flex;
    flex-direction: column;
}

#github-issue-screenshot-container {
    border: 2px dashed #ddd;
    border-radius: 4px;
    min-height: 31rem;
    height: 80vh;
    max-height: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
    padding-top: 20px;
}

#github-issue-screenshot-container img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Screenshot Editor Canvas */
#screenshot-canvas {
    position: relative;
    display: inline-block;
    cursor: crosshair;
height: 100%;
width:100%;
}

#screenshot-canvas canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

#screenshot-canvas canvas.active {
    pointer-events: all;
}

/* Editor Toolbar - Horizontal Layout */
#screenshot-editor-tools {
    margin-top: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 12px 15px;
    order: 1; /* Kommt vor dem Screenshot */
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
}

.tool-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    min-width: auto;
}

.tool-group h4 {
    margin: 0;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: bold;
    margin-right: 8px;
    white-space: nowrap;
}

.tool-group:first-child .tool-btn {
    margin-right: 5px;
}

/* Screenshot Container - kommt nach Toolbar */
#github-issue-screenshot-container {
    border: 2px dashed #ddd;
    border-radius: 4px;
    min-height: 21rem;
    height: 80vh;
    max-height: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #f9f9fa;
    position: relative;
    overflow: hidden;
    order: 2; /* Kommt nach der Toolbar */
    padding-top: 20px;
}

/* Screenshot Section Flexbox */
.github-issue-screenshot-section {
    display: flex;
    flex-direction: column;
}

.github-issue-screenshot-section h3 {
    order: 0; /* Überschrift zuerst */
    margin-bottom: 10px;
}

.tool-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.tool-btn.active {
    border-color: #007cba;
    background: #007cba;
    color: white;
}

.tool-btn span {
    font-size: 18px;
color: #000;
}

/* Farbauswahl */
#color-picker {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.color-preset {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.2);
}

.color-preset.active {
    transform: scale(1.3);
    box-shadow: 0 0 0 2px #007cba;
}

/* Strichstärke */
#stroke-width {
    width: 80px;
}

#stroke-width-display {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

/* Aktions-Buttons */
#delete-selected,
#clear-all,
#undo-action {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
color: #000;
}

#delete-selected:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

#clear-all:hover {
    background: #ffc107;
    border-color: #ffc107;
}

#undo-action:hover {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

/* Canvas Overlay Elemente mit visuellen Hilfen */
.canvas-element {
    position: absolute;
    cursor: move;
    border: 2px dashed transparent;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.canvas-element.selected {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    background: rgba(0, 124, 186, 0.05);
}

.canvas-element.hover {
    border-color: rgba(0, 124, 186, 0.6);
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.1);
}

/* Auswahlgriffe für ausgewählte Elemente */
.canvas-element .resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #007cba;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nw-resize;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.canvas-element.selected .resize-handle {
    opacity: 1;
}

.canvas-element .resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.canvas-element .resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.canvas-element .resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.canvas-element .resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

/* Live-Vorschau für Drawing */
.preview-element {
    opacity: 0.7;
    pointer-events: none;
}

/* Spezielle Cursor für verschiedene Tools */
#screenshot-canvas.tool-pen {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/></svg>') 0 24, auto;
}

#screenshot-canvas.tool-text {
    cursor: text;
}

#screenshot-canvas.tool-blur {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"><circle cx="12" cy="12" r="10" opacity="0.5"/></svg>') 12 12, auto;
}

#screenshot-canvas.tool-rectangle,
#screenshot-canvas.tool-circle,
#screenshot-canvas.tool-arrow {
    cursor: crosshair;
}

#screenshot-canvas.tool-select {
    cursor: default;
}

/* Text-Element */
.text-element {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    min-width: 50px;
    min-height: 20px;
}

.text-element input {
    background: transparent;
    border: none;
    outline: none;
    font: inherit;
    color: inherit;
    width: 100%;
}

/* Responsive Design für Editor */
@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .tool-group {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-start;
        min-width: auto;
    }
    
    .tool-group h4 {
        margin-right: 10px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .color-presets {
        margin-top: 0;
        margin-left: 8px;
    }
    
    .tool-group:first-child {
        order: -1; /* Werkzeuge zuerst auf Mobile */
    }
}

@media (max-width: 480px) {
    #screenshot-editor-tools {
        padding: 8px 10px;
    }
    
    .tool-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .tool-group h4 {
        font-size: 10px;
    }
    
    .editor-toolbar {
        gap: 8px;
    }
    
    .tool-group {
        gap: 6px;
    }
}

/* Loading Animation */
.github-issue-loading {
    text-align: center;
    color: #666;
}

.github-issue-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Erfolgsmeldung */
.github-issue-success {
    text-align: center;
    padding: 40px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 20px;
}

.github-issue-success h3 {
    color: #155724;
    margin-bottom: 10px;
}

.github-issue-success p {
    color: #155724;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .github-issue-btn {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        top: auto;
        bottom: 20px;
        right: 20px;
        max-width: none;
        border-radius: 25px;
        padding: 10px 15px;
    }
    
    .github-issue-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .github-issue-modal-body {
        padding: 15px;
    }
}