/* ===== CSS VARIABLES ===== */
:root {
    --bg-color: #000;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --container-bg: #121212;
    --tile-bg: #1e1e1e;
    --tile-hover-bg: #2a2a2a;
    --text-color: #fff;
    --text-primary: #fff;
    --text-secondary: #a8a8a8;
    --subtext-color: #a8a8a8;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-gradient: linear-gradient(45deg, #973BED, #007CFF, #00E0ED);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

.light-theme {
    --bg-color: #f5f5f5;
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --container-bg: #ffffff;
    --tile-bg: #eaeaea;
    --tile-hover-bg: #d8d8d8;
    --text-color: #121212;
    --text-primary: #121212;
    --text-secondary: #555555;
    --subtext-color: #555555;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-container {
    text-align: center;
    position: relative;
}

.brand-text {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    background: var(--accent-gradient);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.loader svg {
    width: 64px;
    height: 64px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 0.1em;
    margin-top: 1rem;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 1.5rem auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #973BED, #007CFF, #00E0ED);
    border-radius: 2px;
    animation: progressFill 4s ease-in-out infinite;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #973BED;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; background: #00E0ED; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; background: #FFC800; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; background: #00DA72; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { left: 60%; animation-delay: 0.5s; background: #007CFF; }
.particle:nth-child(7) { left: 70%; animation-delay: 1.5s; background: #F0F; }
.particle:nth-child(8) { left: 80%; animation-delay: 2.5s; background: #00E0ED; }
.particle:nth-child(9) { left: 90%; animation-delay: 3.5s; }

/* ===== MAIN CONTENT ===== */
.main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.main-content.visible {
    opacity: 1;
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* width: 100%; */
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 1rem 2rem;
    /* background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px); */
    z-index: 100;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 10px;
    transition: var(--transition);
}

.share-button:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
}

/* ===== THEME SWITCH ===== */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #2a2a2a;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.light-theme .slider {
    background-color: #d8d8d8;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider {
    background-color: #2a2a2a;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.moon-icon, .sun-icon {
    width: 14px;
    height: 14px;
    color: white;
    z-index: 1;
}

.moon-icon {
    margin-left: auto;
}

.sun-icon {
    margin-right: auto;
}

.light-theme .moon-icon, .light-theme .sun-icon {
    color: #555;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--container-bg);
    border-radius: 15px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

/* ===== PROFILE SECTION ===== */
.image-container {
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    /* border: 4px solid; */
    border-image: var(--accent-gradient) 1;
    animation: glow 3s ease-in-out infinite alternate;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    font-size: 22px;
    color: var(--text-color);
    margin-bottom: 6px;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: color 0.3s ease;
}

.container > p {
    font-size: 14px;
    color: var(--subtext-color);
    margin-bottom: 28px;
    text-align: center;
    transition: color 0.3s ease;
}

/* ===== LINK TILES ===== */
.tile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 16px 20px;
    margin: 12px 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tile:hover {
    background: var(--tile-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.tile:hover::before {
    left: 100%;
}

.tile .icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile .icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.tile p {
    flex-grow: 1;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
}

.tile-share-button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.tile:hover .tile-share-button {
    opacity: 1;
}

.tile-share-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tile-share-button svg {
    width: 18px;
    height: 18px;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--tile-bg);
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 6px var(--shadow-color);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* ===== ANIMATIONS ===== */
@keyframes bgMove {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes progressFill {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(151, 59, 237, 0.3); }
    to { box-shadow: 0 0 40px rgba(151, 59, 237, 0.6); }
}

@keyframes dashArray {
    0% { stroke-dasharray: 0 1 359 0; }
    50% { stroke-dasharray: 0 359 1 0; }
    100% { stroke-dasharray: 359 1 0 0; }
}

@keyframes spinDashArray {
    0% { stroke-dasharray: 270 90; }
    50% { stroke-dasharray: 0 360; }
    100% { stroke-dasharray: 270 90; }
}

@keyframes dashOffset {
    0% { stroke-dashoffset: 365; }
    100% { stroke-dashoffset: 5; }
}

@keyframes spin {
    0% { rotate: 0deg; }
    12.5%, 25% { rotate: 270deg; }
    37.5%, 50% { rotate: 540deg; }
    62.5%, 75% { rotate: 810deg; }
    87.5%, 100% { rotate: 1080deg; }
}

.dash {
    animation: dashArray 2s ease-in-out infinite,
              dashOffset 2s linear infinite;
}

.spin {
    animation: spinDashArray 2s ease-in-out infinite,
              spin 8s ease-in-out infinite,
              dashOffset 2s linear infinite;
    transform-origin: center;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .brand-text {
        font-size: 2rem;
    }
    
    .loader svg {
        width: 48px;
        height: 48px;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    header {
        padding: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .tile {
        padding: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .brand-text {
        font-size: 1.5rem;
    }
    
    .image-container {
        width: 80px;
        height: 80px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .container {
        max-width: 90%;
        border-radius: 10px;
        padding: 20px;
    }

    .tile {
        margin: 10px 0;
        padding: 14px 18px;
    }

    .tile .icon {
        width: 22px;
        height: 22px;
        margin-right: 12px;
    }

    .tile p {
        font-size: 15px;
    }
    
    header {
        padding: 0 10px;
    }
    
    .theme-switch {
        width: 50px;
        height: 28px;
    }
    
    .slider:before {
        height: 20px;
        width: 20px;
    }
    
    input:checked + .slider:before {
        transform: translateX(22px);
    }
    
    .toast {
        width: 80%;
        text-align: center;
        padding: 10px;
    }
}

@media screen and (max-width: 320px) {
    .image-container {
        width: 80px;
        height: 80px;
    }

    h1 {
        font-size: 18px;
    }

    .container > p {
        font-size: 13px;
    }

    .tile {
        padding: 12px 16px;
    }
    
    .theme-switch {
        width: 40px;
    }
    
    input:checked + .slider:before {
        transform: translateX(12px);
    }
}