/* =========================================
   VARIABLES & BASE
   ========================================= */
:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(180, 220, 255, 0.2);
    --accent-color: #e6f0fa;
    --radius: 24px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-main: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* For custom cursor */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =========================================
   CUSTOM CURSOR
   ========================================= */
.cursor {
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.cursor-glow {
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, transform 0.2s ease-out;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.cursor.hovered {
    transform: translate(-50%, -50%) scale(0.5);
}

.cursor-glow.hovered {
    width: 60px;
    height: 60px;
    border-color: rgba(255, 255, 255, 0.3);
}

/* =========================================
   LOADING SCREEN
   ========================================= */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================
   BACKGROUND BLOBS
   ========================================= */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(10,30,50,0) 70%);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(50,100,150,0.15) 0%, rgba(10,30,50,0) 70%);
    bottom: -100px;
    right: -100px;
}

/* =========================================
   LAYOUT & UTILITIES
   ========================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.glass-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: calc(var(--radius) - 8px);
    padding: 24px;
    transition: var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 600;
    color: var(--accent-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    margin-bottom: 0;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    outline: none;
    transition: var(--transition);
    text-align: center;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(255, 50, 50, 0.1);
    color: #ff5555;
    border: 1px solid rgba(255, 50, 50, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 50, 50, 0.2);
}

.w-100 {
    width: 100%;
}

.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

/* =========================================
   HEADER SECTION
   ========================================= */
#header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
}

.profile-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.05));
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

#profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.typing-container {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    height: 30px;
}

.short-desc {
    max-width: 600px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.header-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* =========================================
   SKILLS SECTION
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-item {
    margin-bottom: 15px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.8));
    border-radius: 10px;
    width: 0; /* Animated via JS */
    transition: width 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   TIMELINE (Experience & Ed)
   ========================================= */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-item h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 10px;
}

.timeline-date {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
}

/* =========================================
   PROJECTS
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card:hover .project-img-container img {
    transform: scale(1.05);
}

.project-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

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

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

/* =========================================
   LINKS MANAGER
   ========================================= */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: grab;
}

.link-item:active {
    cursor: grabbing;
}

.link-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 20px;
}

.link-info {
    flex: 1;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 500;
}

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

.link-actions {
    display: flex;
    gap: 10px;
}

.link-actions a {
    padding: 8px 16px;
}

/* Drag and Drop visually */
.link-item.dragging {
    opacity: 0.5;
    background: rgba(255,255,255,0.1);
}

/* =========================================
   SERVICES
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.service-card {
    text-align: center;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    font-weight: 500;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.contact-item i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.social-icon:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-5px);
}

/* =========================================
   MODALS & FORMS
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.admin-content {
    max-width: 800px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    padding: 5px;
    line-height: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    border-color: rgba(255,255,255,0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-main);
}

.tab-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

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

.admin-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.admin-list-item button {
    background: none;
    border: none;
    color: #ff5555;
}

/* =========================================
   BACK TO TOP
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-5px);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .glass-section {
        padding: 30px 20px;
    }
    
    #profile-name {
        font-size: 2rem;
    }
    
    .cursor, .cursor-glow {
        display: none; /* Hide custom cursor on mobile */
    }
    
    * {
        cursor: auto;
    }
    
    .header-buttons {
        flex-direction: column;
    }
    
    .link-item {
        flex-direction: column;
        text-align: center;
    }
    
    .link-icon-box {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .link-actions {
        margin-top: 15px;
    }
}

/* =========================================
   ADMIN MODE
   ========================================= */
.admin-only {
    display: none !important;
}

body.admin-mode .admin-only {
    display: inline-block !important;
}

body.admin-mode div.admin-only {
    display: block !important;
}

.profile-edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}
.profile-edit-btn:hover {
    background: rgba(255,255,255,0.2);
}
body.admin-mode .profile-edit-btn.admin-only {
    display: flex !important;
}
