/* ============================================
   STAFFELGESCHOSS-PRÜFER CSS
   Stand: 2025 - Vollständig responsiv
   ============================================ */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Widget Container Reset */
.staffelgeschoss-widget {
    all: initial;
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1f36;
    font-size: 16px;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.staffelgeschoss-widget *,
.staffelgeschoss-widget *::before,
.staffelgeschoss-widget *::after {
    box-sizing: border-box;
}

/* CSS Variables */
.staffelgeschoss-widget {
    --primary: #1a1f36;
    --accent: #2d5016;
    --accent-light: #4a7c28;
    --success: #4a7c28;
    --warning: #ffb800;
    --danger: #ff4757;
    --background: #f8f9fb;
    --surface: #ffffff;
    --text-primary: #1a1f36;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Main Container */
.staffelgeschoss-widget .widget-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
}

/* Header */
.staffelgeschoss-widget .widget-header {
    text-align: center;
    margin-bottom: 32px;
}

.staffelgeschoss-widget .widget-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.staffelgeschoss-widget .widget-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form Section */
.staffelgeschoss-widget .form-section {
    margin-bottom: 32px;
}

.staffelgeschoss-widget .form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Bundesland Selection Grid */
.staffelgeschoss-widget .bundesland-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.staffelgeschoss-widget .bundesland-card {
    position: relative;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
    text-align: center;
}

.staffelgeschoss-widget .bundesland-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.staffelgeschoss-widget .bundesland-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.05), rgba(74, 124, 40, 0.05));
}

.staffelgeschoss-widget .bundesland-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.staffelgeschoss-widget .bundesland-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.staffelgeschoss-widget .bundesland-rule {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Slider Groups */
.staffelgeschoss-widget .slider-group {
    margin-bottom: 28px;
}

.staffelgeschoss-widget .slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.staffelgeschoss-widget .slider-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

/* Range Slider */
.staffelgeschoss-widget .slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
}

.staffelgeschoss-widget .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.3);
    transition: all 0.2s;
}

.staffelgeschoss-widget .slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.3);
    transition: all 0.2s;
}

.staffelgeschoss-widget .slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.5);
}

.staffelgeschoss-widget .slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.5);
}

.staffelgeschoss-widget .slider-minmax {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Input Fields */
.staffelgeschoss-widget .input-field {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s;
}

.staffelgeschoss-widget .input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

/* Result Display */
.staffelgeschoss-widget .result-display {
    padding: 32px 24px;
    background: linear-gradient(135deg, #e8f5e0, #f0f9e8);
    border-radius: 16px;
    border: 3px solid var(--success);
    margin-bottom: 24px;
    text-align: center;
    transition: all 0.3s;
}

.staffelgeschoss-widget .result-display.vollgeschoss {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border-color: var(--danger);
}

.staffelgeschoss-widget .result-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.staffelgeschoss-widget .result-status {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
}

.staffelgeschoss-widget .result-display.vollgeschoss .result-status {
    color: var(--danger);
}

.staffelgeschoss-widget .result-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Progress Bar */
.staffelgeschoss-widget .progress-section {
    margin-bottom: 24px;
}

.staffelgeschoss-widget .progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.staffelgeschoss-widget .progress-percentage {
    font-weight: 600;
    color: var(--text-primary);
}

.staffelgeschoss-widget .progress-bar {
    position: relative;
    height: 40px;
    background: var(--border);
    border-radius: 8px;
    overflow: visible;
}

.staffelgeschoss-widget .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
}

.staffelgeschoss-widget .result-display.vollgeschoss ~ .progress-section .progress-fill {
    background: linear-gradient(90deg, var(--danger), #ff6b6b);
}

.staffelgeschoss-widget .progress-threshold {
    position: absolute;
    top: -24px;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    z-index: 10;
}

.staffelgeschoss-widget .threshold-label {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--primary);
}

/* Info Box */
.staffelgeschoss-widget .info-box {
    padding: 20px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    margin-bottom: 24px;
}

.staffelgeschoss-widget .info-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.staffelgeschoss-widget .info-icon {
    font-size: 16px;
}

.staffelgeschoss-widget .info-box-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staffelgeschoss-widget .info-box-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Optimization Tips */
.staffelgeschoss-widget .optimization-tips {
    padding: 20px;
    background: linear-gradient(135deg, #fff9e5, #fff3cd);
    border-radius: 12px;
    border-left: 4px solid var(--warning);
    margin-bottom: 24px;
}

.staffelgeschoss-widget .tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.staffelgeschoss-widget .tips-icon {
    font-size: 16px;
}

.staffelgeschoss-widget .tips-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staffelgeschoss-widget .tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.staffelgeschoss-widget .tips-list li {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.staffelgeschoss-widget .tips-list li:last-child {
    margin-bottom: 0;
}

/* Share Section */
.staffelgeschoss-widget .share-section {
    margin-top: 24px;
}

.staffelgeschoss-widget .btn-share {
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.staffelgeschoss-widget .btn-share:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.staffelgeschoss-widget .share-link-container {
    display: none;
    margin-top: 16px;
    gap: 8px;
}

.staffelgeschoss-widget .share-link-container.active {
    display: flex;
}

.staffelgeschoss-widget .share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    background: var(--background);
    color: var(--text-primary);
}

.staffelgeschoss-widget .btn-copy {
    padding: 10px 20px;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.staffelgeschoss-widget .btn-copy:hover {
    background: var(--surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Toast Notification */
.staffelgeschoss-widget .toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 10000;
}

.staffelgeschoss-widget .toast.show {
    transform: translateY(0);
    opacity: 1;
}

.staffelgeschoss-widget .toast-icon {
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.staffelgeschoss-widget .toast-message {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .staffelgeschoss-widget .widget-container {
        padding: 24px 16px;
        border-radius: 12px;
    }
    
    .staffelgeschoss-widget .widget-title {
        font-size: 24px;
    }

    .staffelgeschoss-widget .slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .staffelgeschoss-widget .slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .staffelgeschoss-widget .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    .staffelgeschoss-widget {
        padding: 12px;
    }

    .staffelgeschoss-widget .bundesland-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .staffelgeschoss-widget .result-icon {
        font-size: 48px;
    }

    .staffelgeschoss-widget .result-status {
        font-size: 20px;
    }

    .staffelgeschoss-widget .share-link-container {
        flex-direction: column;
    }

    .staffelgeschoss-widget .btn-copy {
        width: 100%;
    }
}