"""
Schnellzugriff Widget fuer das Lehrer-Dashboard.

Zeigt schnelle Links zu den wichtigsten Modulen.
"""


class SchnellzugriffWidget:
    widget_id = 'schnellzugriff'
    widget_name = 'Schnellzugriff'
    widget_icon = '&#9889;'  # Lightning
    widget_color = '#6b7280'  # Gray
    default_width = 'full'
    has_settings = True

    @staticmethod
    def get_css() -> str:
        return """
/* ===== Schnellzugriff Widget Styles ===== */
.widget-schnellzugriff {
    background: var(--bp-surface, #1e293b);
    border: 1px solid var(--bp-border, #475569);
    border-radius: 12px;
    padding: 16px;
}

.widget-schnellzugriff .widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.widget-schnellzugriff .widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-text, #e5e7eb);
}

.widget-schnellzugriff .widget-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border-radius: 8px;
    font-size: 14px;
}

.widget-schnellzugriff .quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.widget-schnellzugriff .quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bp-bg, #0f172a);
    border: 1px solid var(--bp-border-subtle, rgba(255,255,255,0.1));
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.widget-schnellzugriff .quick-link:hover {
    background: var(--bp-surface-elevated, #334155);
    border-color: var(--bp-primary, #6C1B1B);
    transform: translateY(-2px);
}

.widget-schnellzugriff .quick-link-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}

.widget-schnellzugriff .quick-link-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--bp-text, #e5e7eb);
    text-align: center;
}

/* Icon colors */
.widget-schnellzugriff .quick-link[data-module="worksheets"] .quick-link-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.widget-schnellzugriff .quick-link[data-module="correction"] .quick-link-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.widget-schnellzugriff .quick-link[data-module="letters"] .quick-link-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.widget-schnellzugriff .quick-link[data-module="jitsi"] .quick-link-icon {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.widget-schnellzugriff .quick-link[data-module="klausur-korrektur"] .quick-link-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.widget-schnellzugriff .quick-link[data-module="messenger"] .quick-link-icon {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.widget-schnellzugriff .quick-link[data-module="school"] .quick-link-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.widget-schnellzugriff .quick-link[data-module="companion"] .quick-link-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
"""

    @staticmethod
    def get_html() -> str:
        return """
<div class="widget-schnellzugriff" data-widget-id="schnellzugriff">
    <div class="widget-header">
        <div class="widget-title">
            <span class="widget-icon">&#9889;</span>
            <span>Schnellzugriff</span>
        </div>
        <button class="widget-settings-btn" onclick="openWidgetSettings('schnellzugriff')" title="Einstellungen">&#9881;</button>
    </div>
    <div class="quick-links">
        <div class="quick-link" data-module="worksheets" onclick="loadModule('worksheets')">
            <div class="quick-link-icon">&#128221;</div>
            <span class="quick-link-label">Arbeitsblatt</span>
        </div>
        <div class="quick-link" data-module="klausur-korrektur" onclick="loadModule('klausur-korrektur')">
            <div class="quick-link-icon">&#10003;</div>
            <span class="quick-link-label">Klausur</span>
        </div>
        <div class="quick-link" data-module="letters" onclick="loadModule('letters')">
            <div class="quick-link-icon">&#9993;</div>
            <span class="quick-link-label">Elternbrief</span>
        </div>
        <div class="quick-link" data-module="jitsi" onclick="loadModule('jitsi')">
            <div class="quick-link-icon">&#127909;</div>
            <span class="quick-link-label">Konferenz</span>
        </div>
        <div class="quick-link" data-module="school" onclick="loadModule('school')">
            <div class="quick-link-icon">&#127979;</div>
            <span class="quick-link-label">Schule</span>
        </div>
        <div class="quick-link" data-module="messenger" onclick="loadModule('messenger')">
            <div class="quick-link-icon">&#128172;</div>
            <span class="quick-link-label">Messenger</span>
        </div>
        <div class="quick-link" data-module="companion" onclick="loadModule('companion')">
            <div class="quick-link-icon">&#128218;</div>
            <span class="quick-link-label">Begleiter</span>
        </div>
        <div class="quick-link" data-module="correction" onclick="loadModule('correction')">
            <div class="quick-link-icon">&#128196;</div>
            <span class="quick-link-label">Material</span>
        </div>
    </div>
</div>
"""

    @staticmethod
    def get_js() -> str:
        return """
// ===== Schnellzugriff Widget JavaScript =====
function initSchnellzugriffWidget() {
    // Quick links are already set up with onclick handlers
    console.log('Schnellzugriff widget initialized');
}
"""
