/* Generelle Tap-Highlight-Entfernung für alle interaktiven Elemente */
.moodle-docs-container button,
.moodle-docs-container a,
.moodle-login-container button,
.moodle-login-container a {
    -webkit-tap-highlight-color: transparent;
}/* Moodle Dokumentenverwaltung Styles - Mobile optimiert mit Darkmode */

/* Grundlegende Container-Styles */
.moodle-docs-container {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    background-color: #292929; /* Dunkler Hintergrund */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    color: #F3F4F6; /* Neue Textfarbe */
}

.moodle-docs-container.mobile-optimized {
    font-size: 16px;
}

.moodle-docs-upload,
.moodle-docs-list {
    margin-bottom: 20px;
}

/* Benutzermenü-Styling */
.moodle-user-menu {
    margin-left: auto;
    display: flex;
    align-items: center; /* Vertikale Zentrierung */
    position: relative;
}

.moodle-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8ce46; /* Neue Akzentfarbe */
    color: #292929; /* Dunkler Text auf grünem Hintergrund für besseren Kontrast */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    position: relative;
    z-index: 110;
    -webkit-tap-highlight-color: transparent; /* Verhindert optische Selektion beim Tippen */
    outline: none; /* Entfernt Fokus-Outline */
}

/* Avatar für nicht angemeldeten Zustand */
.moodle-user-avatar.not-logged-in {
    background-color: #444444; /* Dunklere Farbe für nicht angemeldeten Zustand */
    color: #F3F4F6;
}

.moodle-user-avatar.not-logged-in:hover {
    background-color: #555555;
}

.moodle-user-avatar:hover {
    background-color: #fad968; /* Helleres Grün beim Hover */
}

.moodle-user-initials {
    font-size: 16px;
    text-transform: uppercase;
}

.moodle-user-dropdown {
    position: absolute;
    top: calc(100% + 10px); /* Abstand für den Verbindungspfeil */
    right: 0;
    width: 180px;
    background-color: #333333; /* Dunkler Hintergrund für Dropdown */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    transition: opacity 0.2s, visibility 0.2s;
}

/* Verbindungspfeil zum Button */
.moodle-user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 14px; /* Zentriert unter dem Button */
    border-style: solid;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #333333 transparent;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.2));
}

/* Dropdown für nicht angemeldeten Zustand */
.moodle-user-dropdown.guest-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    z-index: 110;
}

.moodle-user-menu:hover .moodle-user-dropdown {
    /* Hover-Effekt entfernen, da wir jetzt einen Toggle verwenden */
}

/* Aktiver Zustand für das Dropdown-Menü */
.moodle-user-dropdown.active {
    opacity: 1;
    visibility: visible;
}

.moodle-user-fullname {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444444; /* Dunklere Trennlinie */
    color: #e0e0e0;
}

.moodle-user-link {
    margin-bottom: 8px;
}

.moodle-user-link a {
    color: #f8ce46; /* Grüne Linkfarbe passend zum Design */
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: all 0.3s ease;
    font-size: 14px;
}

.moodle-user-link a:hover {
    color: #fad968; /* Helleres Grün beim Hover */
    text-decoration: underline;
}

.moodle-user-logout {
    color: #ff6b6b; /* Helleres Rot für bessere Sichtbarkeit */
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s;
    margin-top: 8px; /* Abstand zu den Links */
    border-top: 1px solid #444444; /* Trennlinie vor dem Abmelde-Button */
    padding-top: 8px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.moodle-user-logout.disabled {
    color: #e0e0e0;
    text-decoration: none;
}

.moodle-user-logout:hover {
    color: #ff8a8a;
    text-decoration: underline;
}

.moodle-user-logout.disabled:hover {
    color: #e0e0e0;
    text-decoration: none;
}

/* Tab Navigation */
.moodle-docs-tabs {
    display: flex;
    border-bottom: 2px solid #444444; /* Dunklere Trennlinie */
    margin-bottom: 20px;
    overflow: visible;
    outline: 0;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #aaaaaa; /* Hellgraue Farbe für inaktive Tabs */
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.tab-button:hover {
    color: #e0e0e0;
}

.tab-button.active {
    color: #f8ce46; /* Neue Akzentfarbe */
    border-bottom-color: #f8ce46;
    border-bottom: 3px solid #f8ce46;
}

/* Tab-Inhalte */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dokumenten-Header mit Titel und Hochladen-Button */
.moodle-docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444444; /* Dunklere Trennlinie */
}

.moodle-docs-header h3 {
    margin: 0;
    color: #F3F4F6;
}

/* Upload-Button neben dem Titel */
#show-upload-form {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #f8ce46; /* Neue Akzentfarbe */
    color: #292929; /* Dunkler Text für besseren Kontrast */
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#show-upload-form:hover {
    background-color: #fad968; /* Helleres Grün beim Hover */
}

/* Schließen-Button für das Upload-Formular */
.moodle-docs-close-button {
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.moodle-docs-close-button:hover {
    color: #ff6b6b;
}

/* Upload-Sektion Styling */
.moodle-docs-upload {
    background-color: #333333; /* Dunklerer Hintergrund */
    border: 1px solid #444444;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.moodle-toggle-section {
    background: none;
    border: none;
    cursor: pointer;
    color: #f8ce46; /* Neue Akzentfarbe */
    font-size: 24px;
    padding: 0;
    line-height: 1;
}

/* Logo-Styling */
.moodle-docs-header-container {
    display: flex;
    align-items: center; /* Vertikale Zentrierung für alle Elemente */
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
    position: relative;
}

.moodle-docs-logo {
    margin-right: auto;
    display: flex;
    align-items: flex-end; /* Logo an der Unterkante ausrichten */
}

.moodle-docs-logo img {
    width: auto;
    max-width: 50px;
    filter: brightness(1.2); /* Logo etwas aufhellen für bessere Sichtbarkeit */
    height: auto;
    max-height: none;
    margin-top: -31px;
}

.moodle-docs-header-container h2 {
    margin: 0;
    flex: 1;
    color: #F3F4F6;
}

/* Upload-Formular */
#moodle-upload-form .form-group {
    margin-bottom: 15px;
}

#moodle-upload-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #F3F4F6;
}

#moodle-upload-form input[type="text"],
#moodle-upload-form input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #444444;
    border-radius: 4px;
    font-size: 16px;
    background-color: #3a3a3a; /* Dunklerer Hintergrund für Eingabefelder */
    color: #F3F4F6;
}

.file-size-info {
    display: block;
    font-size: 0.9em;
    color: #aaaaaa;
    margin-top: 5px;
}

.moodle-docs-button {
    background-color: #f8ce46; /* Neue Akzentfarbe */
    color: #292929; /* Dunkler Text für besseren Kontrast */
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    min-width: 120px;
    text-align: center;
}

.moodle-docs-button:hover {
    background-color: #fad968; /* Helleres Grün beim Hover */
}

/* Dokumentenliste im Card-Stil für bessere mobile Ansicht */
.moodle-docs-items {
    position: relative;
    flex-direction: column;
    gap: 12px;
}

/* Die Listenelemente bleiben hell wie gewünscht */
.moodle-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1;
    position: relative;
    margin-bottom: 5px;
    color: #333333; /* Dunkle Textfarbe für helle Listenelemente */
}

.moodle-doc-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.moodle-doc-info {
    flex-grow: 1;
    z-index: 1;
}

.moodle-doc-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333333;
    word-break: break-word;
}

.moodle-doc-date {
    font-size: 0.9em;
    color: #666666;
}

.moodle-doc-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
    position: relative;
    z-index: 2;
}

/* Action-Buttons */
.moodle-docs-download,
.moodle-docs-delete,
.moodle-docs-share-toggle {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    color: #555;
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.moodle-docs-download:hover {
    background-color: #e1f5fe;
    color: #0288d1;
}

.moodle-docs-delete:hover {
    background-color: #ffebee;
    color: #e53935;
}

.moodle-docs-share-toggle:hover {
    background-color: #e8f5e9;
    color: #43a047;
}

/* Teilen-Menü - Verbesserte z-index-Behandlung */
.moodle-docs-share-container {
    position: relative;
    z-index: 5;
}

.moodle-docs-share-container.active {
    z-index: 1000;
}

.moodle-docs-share-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    background-color: white; /* Hell belassen für besseren Kontrast */
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 5px 0;
    min-width: 150px;
    max-width: 200px;
    display: none;
    z-index: 2000;
}

/* Verbindungspfeil zum Button */
.moodle-docs-share-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 14px;
    border-style: solid;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent white transparent; /* Passend zur weißen Menüfarbe */
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.2));
}

.moodle-docs-share-menu.active {
    display: block;
}

.moodle-doc-item.has-active-menu {
    z-index: 999 !important;
    position: relative;
}

.moodle-doc-item:not(.has-active-menu) {
    z-index: 1;
}

.moodle-docs-share {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    color: #333333; /* Dunkle Textfarbe für besseren Kontrast */
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.moodle-docs-share:hover {
    background-color: #f5f5f5;
}

.moodle-docs-share .dashicons {
    margin-right: 8px;
}

/* Nachricht-Bereich */
.moodle-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.moodle-message.error {
    display: block;
    background-color: rgba(255, 76, 76, 0.15); /* Transparentes Rot */
    border: 1px solid rgba(255, 76, 76, 0.3);
    color: #ff5252;
}

.moodle-message.success {
    display: block;
    background-color: rgba(76, 175, 80, 0.15); /* Transparentes Grün */
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #66bb6a;
}

/* Ladeanimation für Belege */
.moodle-docs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    color: #aaaaaa;
}

.moodle-docs-loading .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    border: 4px solid rgba(129, 254, 88, 0.2); /* Neue Akzentfarbe mit Transparenz */
    border-radius: 50%;
    border-top-color: #f8ce46; /* Neue Akzentfarbe */
    animation: spin 1s linear infinite;
}

/* Ladeanimation für Buttons */
.moodle-docs-button.loading {
    position: relative;
    padding-left: 40px;
}

.moodle-docs-button .spinner {
    position: absolute;
    left: 15px;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Leere Liste */
.moodle-docs-empty {
    text-align: center;
    padding: 30px 0;
    font-style: italic;
    color: #aaaaaa;
}

/* WhatsApp-Icon-Farbe */
.moodle-docs-share[data-share="whatsapp"] .dashicons {
    color: #25D366;
}

/* E-Mail-Icon-Farbe */
.moodle-docs-share[data-share="email"] .dashicons {
    color: #DB4437;
}

/* Responsive Anpassungen */
@media screen and (max-width: 767px) {
    .moodle-docs-container {
        padding: 10px;
        border-radius: 0;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .moodle-doc-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .moodle-doc-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        margin-top: 10px;
    }
    
    /* Mobilansicht: Menü konsistent rechts ausrichten wie auf Desktop */
    .moodle-docs-share-menu {
        right: 0;
        left: auto;
        max-width: calc(100vw - 30px);
        transform: translateX(0);
    }
    
    /* Pfeil konsistent rechts ausrichten wie auf Desktop */
    .moodle-docs-share-menu::before {
        right: 14px;
        left: auto;
    }
    
    /* Mobile Optimierung für Header */
    .moodle-docs-header-container {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .moodle-docs-logo {
        margin-right: auto;
        display: flex;
        align-items: flex-end;
    }

    .moodle-docs-logo img {
        max-width: 50px;
        margin-top: -31px;
    }
    
    .moodle-user-menu {
        margin-left: 10px;
        display: flex;
        align-items: center;
		position: relative;
    }
}

/* Einige Anpassungen für die Dashicons */
.dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* Formularelemente im Container halten */
#upload-form-container .form-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#moodle-document-title, 
#moodle-document-file {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background-color: #3a3a3a; /* Dunklerer Hintergrund für Eingabefelder */
    color: #F3F4F6; /* Neue Textfarbe */
    border: 1px solid #444444;
}

/* Login-Container Styles für Darkmode */
.moodle-login-container {
    background-color: #333333;
    border-radius: 6px;
    padding: 20px;
    margin: 20px auto; /* Auto-Margins für horizontale Zentrierung */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 400px; /* Maximale Breite für bessere Kontrolle */
}

.moodle-login-form .form-group {
    margin-bottom: 15px;
}

.moodle-login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #F3F4F6;
}

.moodle-login-form input[type="text"],
.moodle-login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #444444;
    border-radius: 4px;
    font-size: 16px;
    background-color: #3a3a3a;
    color: #F3F4F6;
    box-sizing: border-box;
}

.moodle-login-form input[type="text"]:focus,
.moodle-login-form input[type="password"]:focus {
    border-color: #f8ce46;
    outline: none;
    box-shadow: 0 0 0 2px rgba(129, 254, 88, 0.2);
}

.moodle-login-form .form-submit {
    margin-top: 20px;
}

.moodle-login-button {
    background-color: #f8ce46;
    color: #292929;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.moodle-login-button:hover {
    background-color: #d94423; /* Dunkleres Grün beim Hover */
    color: #292929; /* Textfarbe beibehalten */
}

/* Nachrichtenstyling für Login */
.moodle-login-form .moodle-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.moodle-login-form .moodle-message.error {
    display: block;
    background-color: rgba(255, 76, 76, 0.15);
    border: 1px solid rgba(255, 76, 76, 0.3);
    color: #ff5252;
}

.moodle-login-form .moodle-message.success {
    display: block;
    background-color: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #66bb6a;
}

/* Footer-Links Styling */
.moodle-footer-links {
	margin-top: auto;
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid #444444; /* Dunklere Trennlinie */
    font-size: 14px;
}

.moodle-footer-link {
    color: #f8ce46; /* Grüne Linkfarbe passend zum Design */
    text-decoration: none;
    transition: color 0.3s;
}

.moodle-footer-link:hover {
    color: #fad968; /* Helleres Grün beim Hover */
    text-decoration: underline;
}

/* Abstand zum Container-Ende hinzufügen */
.moodle-docs-container {
    padding-bottom: 10px;
}

/* Certificate styling */
.moodle-doc-course {
    font-size: 0.85em;
    color: #aaaaaa; /* Light gray for dark mode */
    margin-top: 3px;
}

/* Download status display */
.download-status {
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent white for dark mode */
    padding: 8px;
    margin: 8px 0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
    color: #e0e0e0;
}

.download-status .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(129, 254, 88, 0.2); /* Accent green with transparency */
    border-radius: 50%;
    border-top-color: #f8ce46; /* Accent green */
    vertical-align: middle;
    margin-right: 5px;
    animation: spin 1s linear infinite;
}

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

/* Certificate download button */
.moodle-docs-certificate-download {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    color: #555;
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.moodle-docs-certificate-download:hover {
    background-color: #e1f5fe;
    color: #0288d1;
}

/* Neue Styles für die Userfiles-Ansicht */

/* Bereichsüberschriften */
.moodle-docs-section-title {
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    color: #F3F4F6;
    font-size: 1.1em;
    border-bottom: 1px solid #444444;
}

/* Spezielle Styles für Moodle Userfiles */
.moodle-userfile-item {
    border-left: 3px solid #f8ce46; /* Elegantes Grün am linken Rand */
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
}

.moodle-userfile-item:hover {
    border-left-color: #fad968; /* Helleres Grün beim Hover */
    box-shadow: 0 3px 8px rgba(129, 254, 88, 0.2); /* Grüner Schatten beim Hover */
}

/* Optionale Markierung für Userfiles, z.B. kleines Moodle-Icon */
.moodle-userfile-item .moodle-doc-title::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    background-color: #f8ce46;
    border-radius: 50%;
    vertical-align: middle;
}

/* Anpassungen für Mobile-Ansicht */
@media screen and (max-width: 767px) {
    .moodle-docs-section-title {
        font-size: 1em;
        margin: 15px 0 8px 0;
    }
    
    .moodle-userfile-item .moodle-doc-title::before {
        width: 12px;
        height: 12px;
        margin-right: 4px;
    }
}

/* Indicators for different types */
.no-certificate-badge,
.badge-indicator,
.info-indicator {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.no-certificate-badge {
    color: #999; /* Gray for no certificate */
}

.badge-indicator {
    color: #ff9800; /* Orange for badges */
}

.info-indicator {
    color: #2196F3; /* Blue for info */
}

/* Visual indicators for different certificate types */
.moodle-doc-item[data-type="certificate"] {
    border-left: 3px solid #f8ce46; /* Green accent color */
}

.moodle-doc-item[data-type="badge"] {
    border-left: 3px solid #ff9800; /* Orange */
}

.moodle-doc-item[data-type="course"] {
    border-left: 3px solid #2196F3; /* Blue */
}

.moodle-doc-item[data-type="error"] {
    border-left: 3px solid #f44336; /* Red */
}

.moodle-doc-item[data-type="info"] {
    border-left: 3px solid #9e9e9e; /* Gray */
}

/* Tooltip styling */
.moodle-docs-download,
.moodle-docs-certificate-download,
.moodle-docs-share-toggle,
.no-certificate-badge,
.badge-indicator,
.info-indicator {
    position: relative;
}

.moodle-docs-download::after,
.moodle-docs-certificate-download::after,
.moodle-docs-share-toggle::after,
.no-certificate-badge::after,
.badge-indicator::after,
.info-indicator::after {
    content: attr(aria-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 100;
}

.moodle-docs-download:hover::after,
.moodle-docs-certificate-download:hover::after,
.moodle-docs-share-toggle:hover::after,
.no-certificate-badge:hover::after,
.badge-indicator:hover::after,
.info-indicator:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Mobile optimizations */
@media screen and (max-width: 767px) {
    .download-status {
        font-size: 0.8em;
        padding: 6px;
    }
    
    .moodle-docs-certificate-download,
    .no-certificate-badge,
    .badge-indicator,
    .info-indicator {
        width: 32px;
        height: 32px;
    }
    
    .moodle-docs-certificate-download .dashicons,
    .no-certificate-badge .dashicons,
    .badge-indicator .dashicons,
    .info-indicator .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .moodle-doc-course {
        font-size: 0.8em;
    }
}