:root {
    --mystic-purple: #6b46c1;
    --deep-violet: #4c1d95;
    --enchanted-blue: #3b82f6;
    --arcane-gold: #fbbf24;
    --ethereal-pink: #ec4899;
    --shadow-dark: #1e1b4b;
    --parchment: #fef3c7;
    --crystal-white: #f8fafc;
    --mist-gray: #94a3b8;

    --glow-primary: 0 0 20px rgba(107, 70, 193, 0.6);
    --glow-secondary: 0 0 30px rgba(251, 191, 36, 0.5);

    --transition-magic: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.medievalsharp-regular {
    font-family: "MedievalSharp", cursive;
    font-weight: 400;
    font-style: normal;
}

body {
    font-family: "MedievalSharp", cursive;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: var(--crystal-white);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s infinite;
    opacity: 0.5;
    z-index: -1;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

.mystical-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1e1b4b 0%, transparent 60%),
        radial-gradient(ellipse at top, #4c1d95 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

#magicCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.enchanted-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    position: relative;
}

.logo-container {
    display: inline-block;
    position: relative;
}

.arcane-title {
    font-family: "MedievalSharp", cursive;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.glow-text {
    background: linear-gradient(135deg, var(--mystic-purple), var(--enchanted-blue), var(--ethereal-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--mist-gray);
    font-style: italic;
    letter-spacing: 2px;
}

.grimoire-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.spell-section {
    backdrop-filter: blur(10px);
    padding: 3rem;
    margin-bottom: 2rem;
    display: none;
}

.spell-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-family: "MedievalSharp", cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--arcane-gold);
    text-shadow: var(--glow-secondary);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--mist-gray);
    font-style: italic;
}

.spell-circle {
    position: relative;
}

.upload-zone {
    border: 3px dashed var(--mystic-purple);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(107, 70, 193, 0.1);
    position: relative;
    overflow: hidden;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.upload-zone:hover {
    border-color: var(--arcane-gold);
}

.upload-zone.dragging {
    border-color: var(--ethereal-pink);
    background: rgba(236, 72, 153, 0.2);
    box-shadow: inset 0 0 40px rgba(236, 72, 153, 0.3);
}

.upload-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-text {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--crystal-white);
}

.upload-hint {
    color: var(--mist-gray);
    font-size: 1rem;
}

/* Scroll List */
.scroll-list {
    margin: 2rem 0;
    display: none;
}

.scroll-list.has-scrolls {
    display: block;
}

.scroll-item {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-magic);
}

.scroll-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.scroll-name {
    font-size: 1.1rem;
}

.scroll-remove {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid var(--ethereal-pink);
    color: var(--ethereal-pink);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: var(--transition-magic);
}

.scroll-remove:hover {
    background: var(--ethereal-pink);
    color: white;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.6);
}

.magic-button {
    font-family: "MedievalSharp", cursive;
    font-size: 1.3rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--mystic-purple), var(--enchanted-blue));
    border: 2px solid var(--arcane-gold);
    color: white;
    cursor: pointer;
    display: inline-block;
    position: relative;
    overflow: hidden;
    transition: var(--transition-magic);
    box-shadow: 0 5px 20px rgba(107, 70, 193, 0.5);
}

.magic-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.magic-button:not(:disabled):hover {
    box-shadow: 0 10px 30px rgba(107, 70, 193, 0.7), var(--glow-secondary);
    transform: translateY(-2px);
}

.magic-button.demo-button {
    background: linear-gradient(135deg, var(--arcane-gold), #f59e0b);
    border-color: var(--crystal-white);
    animation: pulseGlow 2s infinite;
}

.magic-button.continue-button {
    background: linear-gradient(135deg, var(--enchanted-blue), #2563eb);
    border-color: var(--arcane-gold);
}

.button-text {
    position: relative;
    z-index: 1;
}

.cauldron-container {
    text-align: center;
    padding: 3rem 0;
}

.cauldron {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
    animation: cauldronBubble 2s ease-in-out infinite;
}

@keyframes cauldronBubble {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.cauldron::before {
    content: '🪄';
    font-size: 8rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 4s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.potion-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.potion-bubbles::before,
.potion-bubbles::after {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    animation: riseBubble 3s infinite;
}

.potion-bubbles::before {
    left: 20%;
    animation-delay: 0s;
}

.potion-bubbles::after {
    right: 20%;
    animation-delay: 1.5s;
}

@keyframes riseBubble {
    0% {
        bottom: 0;
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
    }

    100% {
        bottom: 100%;
        opacity: 0;
        transform: scale(1.5);
    }
}

.brewing-progress {
    max-width: 500px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(30, 27, 75, 0.6);
    border: 2px solid var(--mystic-purple);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mystic-purple), var(--enchanted-blue), var(--ethereal-pink));
    background-size: 200% 100%;
    animation: progressGlow 2s linear infinite;
    width: 0%;
    transition: width 0.5s ease;
}

@keyframes progressGlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.brewing-status {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--arcane-gold);
    font-style: italic;
}

.divination-controls {
    margin-bottom: 2rem;
}

.search-spell {
    margin-bottom: 1.5rem;
}

.oracle-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(30, 27, 75, 0.8);
    border: 2px solid var(--mystic-purple);
    color: var(--crystal-white);
    font-family: "MedievalSharp", cursive;
    transition: var(--transition-magic);
}

.oracle-input:focus {
    outline: none;
    border-color: var(--arcane-gold);
}

.oracle-input::placeholder {
    color: var(--mist-gray);
    font-style: italic;
}

.filter-enchantments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.enchanted-select {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    background: rgba(30, 27, 75, 0.8);
    border: 2px solid rgba(107, 70, 193, 0.5);
    color: var(--crystal-white);
    font-family: "MedievalSharp", cursive;
    cursor: pointer;
    transition: var(--transition-magic);
}

.enchanted-select:hover {
    border-color: var(--mystic-purple);
}

.enchanted-select:focus {
    outline: none;
    border-color: var(--arcane-gold);
}

.enchanted-select option {
    background: var(--shadow-dark);
    color: var(--crystal-white);
}

.clear-spell {
    padding: 0.8rem 1.5rem;
    background: rgba(236, 72, 153, 0.2);
    border: 2px solid var(--ethereal-pink);
    color: var(--ethereal-pink);
    font-family: "MedievalSharp", cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-magic);
}

.clear-spell:hover {
    background: var(--ethereal-pink);
    color: white;
}

.results-counter {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--arcane-gold);
    font-family: "MedievalSharp", cursive;
}

.results-counter span {
    font-size: 2rem;
    font-weight: 700;
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.candidate-card {
    background: rgba(30, 27, 75, 0.7);
    border: 2px solid rgba(107, 70, 193, 0.4);
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.candidate-card:hover {
    border-color: var(--arcane-gold);
    box-shadow: 0 5px 15px rgba(107, 70, 193, 0.4);
}

.candidate-header {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.candidate-name {
    font-family: "MedievalSharp", cursive;
    font-size: 1.5rem;
    color: var(--arcane-gold);
    margin-bottom: 0.3rem;
}

.candidate-title {
    font-size: 1.1rem;
    color: var(--mist-gray);
    font-style: italic;
}

.candidate-info {
    position: relative;
    z-index: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(107, 70, 193, 0.2);
}

.info-label {
    color: var(--mist-gray);
    font-size: 0.95rem;
}

.info-value {
    color: var(--crystal-white);
    font-weight: 600;
}

.candidate-skills {
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.skills-title {
    font-size: 0.9rem;
    color: var(--mist-gray);
    margin-bottom: 0.5rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    color: var(--enchanted-blue);
    transition: var(--transition-magic);
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.4);
}

.enchanted-footer {
    text-align: center;
    padding: 2rem;
    color: var(--mist-gray);
    font-style: italic;
}

@media (max-width: 768px) {
    .arcane-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .spell-section {
        padding: 2rem 1.5rem;
    }

    .vision-grid {
        grid-template-columns: 1fr;
    }

    .filter-enchantments {
        grid-template-columns: 1fr;
    }
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.hidden {
    display: none !important;
}

/* Dashboard Statistics */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(30, 27, 75, 0.7);
    border: 2px solid rgba(107, 70, 193, 0.4);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition-magic);
}

.stat-card:hover {
    border-color: var(--arcane-gold);
    box-shadow: 0 5px 15px rgba(107, 70, 193, 0.4);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--arcane-gold);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--mist-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Profile Modal */
.profile-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.profile-modal.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    margin: 2% auto;
    padding: 0;
    border: 3px solid var(--mystic-purple);
    width: 95%;
    max-width: 1400px;
    box-shadow: 0 10px 50px rgba(107, 70, 193, 0.8);
    position: relative;
    animation: slideDown 0.4s ease;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 3rem;
    font-weight: 700;
    color: var(--ethereal-pink);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-magic);
    line-height: 1;
}

.modal-close:hover {
    color: var(--arcane-gold);
    transform: rotate(90deg);
}

.modal-header {
    background: rgba(107, 70, 193, 0.2);
    padding: 2rem 3rem;
    border-bottom: 2px solid var(--mystic-purple);
}

.modal-candidate-name {
    font-family: "MedievalSharp", cursive;
    font-size: 2.5rem;
    color: var(--arcane-gold);
    text-shadow: var(--glow-secondary);
    margin-bottom: 0.5rem;
}

.modal-candidate-title {
    font-size: 1.3rem;
    color: var(--mist-gray);
    font-style: italic;
}

.modal-tabs {
    display: flex;
    background: rgba(30, 27, 75, 0.6);
    border-bottom: 2px solid var(--mystic-purple);
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--mist-gray);
    font-family: "MedievalSharp", cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-magic);
    border-right: 1px solid rgba(107, 70, 193, 0.3);
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: rgba(107, 70, 193, 0.2);
    color: var(--crystal-white);
}

.tab-btn.active {
    background: rgba(107, 70, 193, 0.4);
    color: var(--arcane-gold);
    border-bottom: 3px solid var(--arcane-gold);
}

.modal-body {
    padding: 2rem 3rem;
    max-height: 60vh;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.profile-section {
    margin-bottom: 2rem;
}

.profile-section-title {
    font-family: "MedievalSharp", cursive;
    font-size: 1.5rem;
    color: var(--arcane-gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(107, 70, 193, 0.4);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.profile-field {
    background: rgba(30, 27, 75, 0.5);
    padding: 1rem;
    border-left: 3px solid var(--mystic-purple);
}

.field-label {
    font-size: 0.9rem;
    color: var(--mist-gray);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.field-value {
    font-size: 1.1rem;
    color: var(--crystal-white);
}

.experience-item,
.education-item,
.project-item {
    background: rgba(30, 27, 75, 0.5);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--enchanted-blue);
}

.experience-item:hover,
.education-item:hover,
.project-item:hover {
    background: rgba(30, 27, 75, 0.7);
    border-left-color: var(--arcane-gold);
}

.item-title {
    font-size: 1.3rem;
    color: var(--arcane-gold);
    margin-bottom: 0.5rem;
}

.item-subtitle {
    font-size: 1.1rem;
    color: var(--enchanted-blue);
    margin-bottom: 0.5rem;
}

.item-meta {
    font-size: 0.95rem;
    color: var(--mist-gray);
    margin-bottom: 1rem;
}

.item-description {
    color: var(--crystal-white);
    line-height: 1.6;
}

.item-list {
    list-style: none;
    padding-left: 0;
}

.item-list li {
    padding: 0.3rem 0 0.3rem 1.5rem;
    position: relative;
    color: var(--crystal-white);
    line-height: 1.5;
}

.item-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--mystic-purple);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: var(--enchanted-blue);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: rgba(30, 27, 75, 0.5);
    padding: 1.5rem;
    border: 2px solid rgba(107, 70, 193, 0.3);
}

.skill-category-title {
    font-size: 1.2rem;
    color: var(--ethereal-pink);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: rgba(107, 70, 193, 0.2);
    border: 1px solid var(--mystic-purple);
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: var(--crystal-white);
}

.insight-box {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.2), rgba(236, 72, 153, 0.2));
    border: 2px solid var(--mystic-purple);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.insight-title {
    font-size: 1.2rem;
    color: var(--arcane-gold);
    margin-bottom: 1rem;
}

.insight-list {
    list-style: none;
    padding: 0;
}

.insight-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--crystal-white);
    line-height: 1.6;
}

.insight-list li::before {
    content: '🔮';
    position: absolute;
    left: 0;
}

.raw-json {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--mystic-purple);
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--crystal-white);
    max-height: 500px;
    overflow-y: auto;
}

.raw-json pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar,
.raw-json::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track,
.raw-json::-webkit-scrollbar-track {
    background: rgba(30, 27, 75, 0.5);
}

.modal-body::-webkit-scrollbar-thumb,
.raw-json::-webkit-scrollbar-thumb {
    background: var(--mystic-purple);
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.raw-json::-webkit-scrollbar-thumb:hover {
    background: var(--arcane-gold);
}

@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-candidate-name {
        font-size: 1.8rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
    }
}