/* ===== Local SVG Icons - Ultimate Fallback ===== */

/* GitHub Icon */
.icon-github-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* Google Scholar Icon (Graduation Cap) */
.icon-scholar-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* ResearchGate Icon */
.icon-researchgate-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19.592 8.296c0 1.531-.815 2.846-1.96 3.531-.744.423-1.582.635-2.474.635-.893 0-1.73-.212-2.474-.635-1.145-.685-1.96-1.999-1.96-3.531 0-1.531.815-2.846 1.96-3.531C13.228 4.34 14.065 4.13 14.958 4.13c.893 0 1.73.211 2.474.635 1.145.685 1.96 2 1.96 3.531M14.958 5.73c-.593 0-1.147.142-1.627.411-.48.269-.864.643-1.126 1.109-.262.466-.389.976-.389 1.507 0 .531.127 1.041.389 1.507.262.466.646.84 1.126 1.109.48.269 1.034.411 1.627.411.593 0 1.147-.142 1.627-.411.48-.269.864-.643 1.126-1.109.262-.466.389-.976.389-1.507 0-.531-.127-1.041-.389-1.507-.262-.466-.646-.84-1.126-1.109-.48-.269-1.034-.411-1.627-.411m2.312 3.921c0 .821-.418 1.521-1.004 1.947-.586.426-1.359.645-2.261.645s-1.675-.219-2.261-.645c-.586-.426-1.004-1.126-1.004-1.947 0-.821.418-1.521 1.004-1.947.586-.426 1.359-.645 2.261-.645s1.675.219 2.261.645c.586.426 1.004 1.126 1.004 1.947M8.238 12.938c-1.779 0-3.294.323-4.418.964-1.124.641-1.72 1.576-1.72 2.741v5.719h1.821v-5.525c0-1.238.615-1.937 1.739-2.099 1.124-.162 2.398-.244 3.702-.244.323 0 .635.008.937.024v-1.811c-.313-.016-.636-.024-.969-.024M5.676 8.714c.563 0 1.08-.095 1.528-.279.448-.184.831-.44 1.129-.756.298-.316.521-.681.65-1.08.129-.399.19-.811.19-1.218 0-.407-.061-.819-.19-1.218-.129-.399-.352-.764-.65-1.08-.298-.316-.681-.572-1.129-.756-.448-.184-.965-.279-1.528-.279-.563 0-1.08.095-1.528.279-.448.184-.831.44-1.129.756-.298.316-.521.681-.65 1.08-.129.399-.19.811-.19 1.218 0 .407.061.819.19 1.218.129.399.352.764.65 1.08.298.316.681.572 1.129.756.448.184.965.279 1.528.279m0-1.531c-.293 0-.562-.049-.795-.142-.233-.093-.437-.221-.601-.377-.164-.156-.291-.336-.373-.531-.082-.195-.121-.397-.121-.597 0-.2.039-.402.121-.597.082-.195.209-.375.373-.531.164-.156.368-.284.601-.377.233-.093.502-.142.795-.142.293 0 .562.049.795.142.233.093.437.221.601.377.164.156.291.336.373.531.082.195.121.397.121.597 0 .2-.039.402-.121.597-.082.195-.209.375-.373.531-.164.156-.368.284-.601.377-.233.093-.502.142-.795.142'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* WeChat Icon */
.icon-wechat-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2307c160'%3E%3Cpath d='M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665L2.83 17.23a.59.59 0 0 0 .798.765l2.936-1.746a.59.59 0 0 1 .512-.063 10.16 10.16 0 0 0 1.615.127c.276 0 .549-.012.819-.035-.058-.333-.088-.673-.088-1.019 0-4.055 3.891-7.342 8.691-7.342 1.926 0 3.69.533 5.078 1.425a6.44 6.44 0 0 1 1.734 1.534c-2.3-.934-4.886-.734-7.102.566-2.215 1.3-3.997 3.428-4.33 5.844-.333 2.416.403 4.544 2.615 5.844 2.212 1.3 4.428 1.5 6.728.566 2.215-1.3 3.997-3.428 4.33-5.844.333-2.416-.403-4.544-2.615-5.844a7.9 7.9 0 0 0-1.734-1.534c1.388-.892 3.152-1.425 5.078-1.425 4.8 0 8.691 3.287 8.691 7.342 0 .346-.03.686-.088 1.019.27.023.543.035.819.035a10.16 10.16 0 0 0 1.615-.127.59.59 0 0 1 .512.063l2.936 1.746a.59.59 0 0 0 .798-.765l-1.385-2.335a.59.59 0 0 1 .213-.665c1.832-1.347 3.002-3.338 3.002-5.55 0-4.054-3.891-7.342-8.691-7.342z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* User Icon */
.icon-user-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* File Icon */
.icon-file-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* Envelope Icon */
.icon-envelope-local {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* Fallback class for when Font Awesome fails */
.fa-fallback {
    display: inline-block;
    width: 1em;
    height: 1em;
    text-align: center;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Icon fallback mapping */
.fa-github.fa-fallback,
.fab.fa-github.fa-fallback {
    @extend .icon-github-local;
}

.fa-graduation-cap.fa-fallback,
.fas.fa-graduation-cap.fa-fallback {
    @extend .icon-scholar-local;
}

.fa-researchgate.fa-fallback,
.fab.fa-researchgate.fa-fallback {
    @extend .icon-researchgate-local;
}

.fa-weixin.fa-fallback,
.fab.fa-weixin.fa-fallback {
    @extend .icon-wechat-local;
}

.fa-user.fa-fallback,
.fas.fa-user.fa-fallback {
    @extend .icon-user-local;
}

.fa-file-alt.fa-fallback,
.fas.fa-file-alt.fa-fallback {
    @extend .icon-file-local;
}

.fa-envelope.fa-fallback,
.fas.fa-envelope.fa-fallback {
    @extend .icon-envelope-local;
}

/* Dark mode adjustments for local icons */
[data-theme="dark"] .icon-github-local,
[data-theme="dark"] .icon-scholar-local,
[data-theme="dark"] .icon-researchgate-local {
    filter: brightness(1.2) contrast(1.1);
}

[data-theme="dark"] .icon-wechat-local {
    filter: brightness(1.1) saturate(1.2);
}

/* Size variations */
.icon-github-local.fa-2x,
.icon-scholar-local.fa-2x,
.icon-researchgate-local.fa-2x,
.icon-wechat-local.fa-2x,
.icon-user-local.fa-2x,
.icon-file-local.fa-2x,
.icon-envelope-local.fa-2x {
    width: 2em;
    height: 2em;
}

.icon-github-local.fa-lg,
.icon-scholar-local.fa-lg,
.icon-researchgate-local.fa-lg,
.icon-wechat-local.fa-lg,
.icon-user-local.fa-lg,
.icon-file-local.fa-lg,
.icon-envelope-local.fa-lg {
    width: 1.33em;
    height: 1.33em;
}

/* Animation for fallback icons */
.fa-fallback {
    transition: all 0.3s ease;
}

.fa-fallback:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* Notification for icon loading status */
.icon-loading-notification {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #ffc107;
    color: #000;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.icon-loading-notification.show {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="dark"] .icon-loading-notification {
    background: #ff6b35;
    color: #fff;
}