@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #09090b;
    --bg-card: rgba(24, 24, 27, 0.4);
    --border-card: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-indigo: #6366f1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.5);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.5);
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
}

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

html, body {
    height: 100%;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    background-color: var(--bg-dark);
}

/* Base background layer */
.app-container {
    background-color: transparent;
    position: relative;
    z-index: 1;
}

/* Matrix Background */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; 
    opacity: 0.15; /* Dimmer for a subtle, darker look */
    pointer-events: none;
}

/* Animated Mesh Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.05) 0%, transparent 50%);
    opacity: 0.8;
}

.bg-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-indigo-glow) 0%, transparent 70%);
    filter: blur(80px);
    border-radius: 50%;
    z-index: -3;
    animation: drift 25s infinite alternate ease-in-out;
}

.bg-blob-2 {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-emerald-glow) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 50px) scale(1.1); }
    100% { transform: translate(-50px, 150px) scale(0.9); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout */
.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .font-heading {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Masthead Section */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.avatar-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-card);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.avatar-image:hover {
    transform: scale(1.05);
}

.avatar-decoration {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 1;
}

.status-dot {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 4px solid var(--bg-dark);
    box-shadow: 0 0 15px currentColor;
    z-index: 2;
}

.status-online { color: var(--accent-emerald); background-color: var(--accent-emerald); }
.status-idle { color: var(--accent-amber); background-color: var(--accent-amber); }
.status-dnd { color: var(--accent-rose); background-color: var(--accent-rose); }
.status-offline { color: var(--text-muted); background-color: var(--text-muted); }

.profile-info {
    text-align: center;
}

.username {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.discriminator {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* About Me Section */
.about-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-indigo);
    margin-bottom: 0.5rem;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Activities */
.activity-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card);
}

.activity-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
}

.activity-details {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-state {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Spotify Special Styling */
.spotify-item {
    border-left: 4px solid var(--accent-emerald);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-emerald);
    width: 0%;
    transition: width 1s linear;
}

.spotify-time-container {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 100%;
}

.spotify-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.spotify-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.spotify-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-emerald);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.spotify-btn i {
    width: 14px;
    height: 14px;
}

/* Tabs Navigation */
.tabs-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    color: white;
    background: var(--accent-indigo);
    box-shadow: 0 0 15px var(--accent-indigo-glow);
}

.tabs-content-container {
    position: relative;
    min-height: 500px; /* Prevent layout jumps */
}

.tab-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.4s ease, visibility 0.4s;
    pointer-events: none;
}

.tab-content.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    pointer-events: auto;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* History/Timeline Section */
.history-section {
    margin-top: 1rem; /* Adjusted for tabs */

    position: relative;
    padding-bottom: 2rem;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 2rem auto 0;
    padding-left: 2rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-indigo), transparent);
    box-shadow: 0 0 15px var(--accent-indigo-glow);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-indigo);
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 10px var(--accent-indigo-glow);
    z-index: 2;
}

.timeline-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-indigo-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.timeline-content {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--accent-indigo);
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.05);
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-indigo);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Projects Section */
.projects-section {
    margin-top: 3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px -10px var(--accent-indigo-glow);
    border-color: var(--accent-indigo);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex: 1;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-indigo);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-indigo);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px var(--accent-indigo-glow);
}

/* Navigation & Footer */
.lang-selector {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

#language-selector {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-card);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
}

.social-link {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-image {
    max-width: 100%;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

/* Utilities */
.hidden { display: none !important; }
.text-white { color: white !important; }

@media (max-width: 768px) {
    .username { font-size: 1.8rem; }
    .avatar-container { width: 120px; height: 120px; }
    .lang-selector { top: 1rem; right: 1rem; }
}
