/* ========================================
   ABDURRAHMAN.TOP - PREMIUM PORTFOLIO
   Custom Styles - Glassmorphism, Animations, Light Mode Only
   WITH RESPONSIVE FIXES & ALTERNATING TIMELINE
   ======================================== */

/* ===== CSS VARIABLES (Light Theme Only) ===== */
:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-alt: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Accent Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    --gradient-secondary: linear-gradient(135deg, #10b981, #14b8a6);
    
    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Space Grotesk', var(--font-body);
    
    /* Spacing & Layout */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.75rem;
    --border-radius-lg: 1.25rem;
    --border-radius-xl: 1.5rem;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    /* Fix for iOS viewport height */
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

/* Responsive font sizes using clamp */
h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.1rem, 2vw, 1.25rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== GLASSMORPHISM UTILITIES ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.glass:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ===== GRADIENTS & TEXT EFFECTS ===== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    /* Ensure touch targets are large enough */
    min-height: 44px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    color: white;
}

.btn-outline-glass {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-glass:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.btn-glow:hover::after {
    opacity: 1;
}

/* ===== NAVBAR ===== */
.navbar {
    padding: 1rem 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.navbar-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    font-family: var(--font-heading);
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    /* Better touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.btn-contact {
    background: var(--gradient-primary);
    color: white !important;
    padding: 0.5rem 1.25rem !important;
}

.nav-link.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    /* Larger touch target */
    min-width: 44px;
    min-height: 44px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%236366f1' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    padding-top: 100px;
    padding-bottom: 60px;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    z-index: -1;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.badge-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    color: var(--text-primary);
}

.hero-title {
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    color: var(--text-secondary);
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    max-width: 550px;
}

.hero-stats {
    gap: 1rem;
}

.stat-card {
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 140px;
}

.stat-number {
    display: block;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: var(--text-muted);
}

.profile-glass {
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.profile-image {
    position: relative;
    display: inline-block;
}

.profile-image img {
    width: clamp(150px, 30vw, 200px);
    height: clamp(150px, 30vw, 200px);
    object-fit: cover;
    border: 4px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.status-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
}

.status-badge.online {
    background: #10b981;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 10px rgba(16, 185, 129, 0.5);
}

.profile-info h5 {
    margin-bottom: 0.25rem;
}

.btn-contact-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.btn-contact-small:hover {
    color: var(--primary-dark);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    transition: all var(--transition-fast);
    /* Touch target */
    min-width: 44px;
    min-height: 44px;
}

.social-icon:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.scroll-mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { opacity: 1; top: 8px; }
    100% { opacity: 0; top: 20px; }
}

.scroll-text {
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* ===== SECTIONS ===== */
.section-padding {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-header {
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.section-title {
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.bg-alt {
    background-color: var(--bg-alt);
}

/* ===== ABOUT SECTION ===== */
.about-image-wrapper {
    position: relative;
}

.about-image {
    padding: 1rem;
    overflow: hidden;
}

.about-image img {
    transition: transform var(--transition-slow);
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-title {
    margin-bottom: 1.5rem;
}

.about-text {
    font-size: clamp(1rem, 2vw, 1.05rem);
}

.about-details {
    padding: 1.5rem;
    background: var(--glass-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
}

.detail-item {
    font-size: clamp(0.95rem, 2vw, 1rem);
}

.detail-item i {
    width: 20px;
    text-align: center;
}

/* ===== SKILLS SECTION ===== */
.skill-card {
    padding: 2rem;
    height: 100%;
}

.skill-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.skill-title {
    margin-bottom: 1.5rem;
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-bar {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bg {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease-out;
}

.tech-stack {
    padding-top: 2rem;
}

.tech-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.tech-icon:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--gradient-primary);
    color: white;
}

/* ===== SERVICES SECTION ===== */
.service-card {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-secondary);
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.service-title {
    margin-bottom: 0.75rem;
}

.service-desc {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.service-list i {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* ===== TIMELINE STYLES (Experience & Education) ===== */
/* Base timeline container */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 30px;
}

/* Center line */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--border-color);
}

/* Timeline item */
.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}

/* Dot on timeline */
.timeline-dot {
    position: absolute;
    left: -34px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
    z-index: 1;
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50px;
}

.timeline-content {
    padding: 1.5rem;
}

.timeline-title {
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.timeline-desc {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-tags .badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* ===== ALTERNATING TIMELINE ===== */
/* Experience timeline - items on LEFT (default) */
.timeline-left .timeline-item {
    padding-left: 60px;
}

.timeline-left .timeline-content {
    margin-left: 0;
    text-align: left;
}

/* Education timeline - items on RIGHT */
.timeline-right {
    padding-left: 0;
    padding-right: 30px;
}

.timeline-right::before {
    left: auto;
    right: 0;
}

.timeline-right .timeline-item {
    padding-right: 60px;
    padding-left: 0;
    text-align: right;
}

.timeline-right .timeline-dot {
    left: auto;
    right: -34px;
}

.timeline-right .timeline-date {
    margin-left: auto;
}

.timeline-right .timeline-content {
    margin-right: 0;
    text-align: right;
}

/* ===== PROJECTS SECTION ===== */
.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-image {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.project-image img {
    transition: transform var(--transition-slow);
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tech .badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.project-link:hover {
    color: var(--primary);
}

/* ===== ACHIEVEMENTS SECTION ===== */
.achievement-card {
    padding: 2rem 1.5rem;
    text-align: center;
}

.achievement-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.achievement-number {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

.achievement-text {
    color: var(--text-muted);
    font-weight: 500;
}

.certifications {
    padding-top: 2rem;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== TESTIMONIALS SECTION ===== */
.testimonial-card {
    max-width: 700px;
    margin: 0 auto;
}

.testimonial-avatar img {
    border: 3px solid var(--glass-border);
}

.testimonial-rating {
    font-size: 1.1rem;
}

.testimonial-text {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    font-style: italic;
    color: var(--text-secondary);
}

.testimonial-name {
    margin-bottom: 0.25rem;
}

.testimonial-role {
    font-size: 0.95rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary);
    border-radius: 50%;
    padding: 1rem;
    width: auto;
    height: auto;
}

/* ===== CONTACT SECTION ===== */
.contact-info {
    padding-right: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    color: white;
    flex-shrink: 0;
}

.contact-details h5 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.contact-details p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.contact-details a {
    color: var(--text-secondary);
}

.contact-details a:hover {
    color: var(--primary);
}

.contact-form {
    padding: 2rem;
}

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    /* Better mobile input */
    font-size: 1rem;
    min-height: 48px;
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-brand {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 700;
    font-family: var(--font-heading);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-fast);
    /* Touch target */
    min-height: 44px;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links i {
    font-size: 0.75rem;
    color: var(--primary);
}

.footer-bottom {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--primary);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1001;
    box-shadow: var(--shadow-glow);
    /* Touch target */
    min-width: 44px;
    min-height: 44px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.6);
}

/* ===== PRELOADER ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== CUSTOM CURSOR (Desktop Only) ===== */
@media (min-width: 1024px) {
    .cursor-dot,
    .cursor-outline {
        position: fixed;
        top: 0;
        left: 0;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        z-index: 9999;
        pointer-events: none;
        transition: transform var(--transition-fast);
    }
    
    .cursor-dot {
        width: 8px;
        height: 8px;
        background: var(--primary);
    }
    
    .cursor-outline {
        width: 40px;
        height: 40px;
        border: 2px solid var(--primary);
        transition: width var(--transition-fast), height var(--transition-fast), background var(--transition-fast);
    }
    
    body.hovering .cursor-outline {
        width: 60px;
        height: 60px;
        background: rgba(99, 102, 241, 0.1);
        border-color: transparent;
    }
}

/* Hide custom cursor on mobile */
@media (max-width: 1023px) {
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* ===== RESPONSIVE FIXES - COMPREHENSIVE ===== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .hero-section {
        text-align: center;
        padding-top: 120px;
    }
    
    .hero-content {
        margin-bottom: 3rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .profile-glass {
        margin: 0 auto;
    }
    
    .contact-info {
        padding-right: 0;
        margin-bottom: 2rem;
    }
    
    /* Timeline responsive */
    .timeline,
    .timeline-left,
    .timeline-right {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .timeline::before,
    .timeline-right::before {
        left: 5px;
        right: auto;
    }
    
    .timeline-item,
    .timeline-left .timeline-item,
    .timeline-right .timeline-item {
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }
    
    .timeline-dot,
    .timeline-right .timeline-dot {
        left: -29px;
        right: auto;
    }
    
    .timeline-right .timeline-date {
        margin-left: 0;
    }
    
    .timeline-right .timeline-content {
        text-align: left;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Global spacing */
    .section-padding {
        padding: clamp(2.5rem, 7vw, 4rem) 0;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Typography */
    h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
    
    /* Navbar */
    .navbar-collapse {
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-radius: var(--border-radius-lg);
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        justify-content: center;
    }
    
    /* Hero */
    .hero-section {
        padding-top: 140px;
        padding-bottom: 40px;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.25rem);
    }
    
    .hero-description {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    }
    
    .stat-card {
        min-width: 120px;
        padding: 0.75rem 1rem;
    }
    
    .stat-number {
        font-size: clamp(1.25rem, 4vw, 1.5rem);
    }
    
    .profile-image img {
        width: clamp(120px, 35vw, 150px);
        height: clamp(120px, 35vw, 150px);
    }
    
    /* Cards */
    .skill-card,
    .service-card,
    .project-card,
    .contact-form,
    .testimonial-card {
        padding: 1.5rem;
    }
    
    /* Timeline mobile */
    .timeline,
    .timeline-left,
    .timeline-right {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .timeline::before {
        left: 3px;
    }
    
    .timeline-item,
    .timeline-left .timeline-item,
    .timeline-right .timeline-item {
        padding-left: 40px;
        padding-right: 0;
    }
    
    .timeline-dot,
    .timeline-right .timeline-dot {
        left: -25px;
        width: 14px;
        height: 14px;
    }
    
    .timeline-content {
        padding: 1.25rem;
    }
    
    .timeline-date {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    /* Form */
    .form-control {
        font-size: 1rem;
        min-height: 50px;
    }
    
    .btn {
        min-height: 50px;
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-brand {
        font-size: 1.5rem;
    }
    
    .footer-links a {
        padding: 0.5rem 0;
    }
    
    /* Back to top */
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        bottom: 1.5rem;
        left: 1.5rem;
    }
    
    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-card {
        width: 100%;
        max-width: 250px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .project-tech,
    .timeline-tags {
        justify-content: center;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
}

/* ===== UTILITY CLASSES ===== */
.min-vh-100 {
    min-height: 100vh;
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: end;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.rounded-circle { border-radius: 50% !important; }
.rounded-3 { border-radius: var(--border-radius-md) !important; }
.rounded-4 { border-radius: var(--border-radius-lg) !important; }

.img-fluid { max-width: 100%; height: auto; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scroll offset for navbar */
section {
    scroll-margin-top: 100px;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Success message styling */
#formStatus {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
}

#formStatus.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#formStatus.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Print styles */
@media print {
    .back-to-top,
    .scroll-indicator,
    .navbar,
    .footer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
/* Focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
.form-control:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}