/* ==========================================================================
   Rafie Habibi - Portfolio Stylesheet (CSS)
   ========================================================================== */

/* Custom CSS Variables & Dark Mode Variables */
:root {
    --accent: #f97316;
    --accent-dark: #ea580c;
    --accent-light: rgba(249, 115, 22, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-theme: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                         color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                         border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                         box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem; /* Prevents navbar from covering section titles when scrolling */
}

body {
    transition: var(--transition-theme);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f9fafb;
    transition: var(--transition-theme);
}
.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

/* Typing animation cursor */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--accent);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

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

/* Glassmorphism Navigation */
nav {
    transition: var(--transition-theme), height var(--transition-normal);
}
.nav-scrolled {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}
.dark .nav-scrolled {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

/* Scroll Spy - Active Navigation Style */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width var(--transition-normal);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}
.nav-link.active {
    color: var(--accent) !important;
}

/* Ambient Float & Spin Animations */
.animate-spin-slow {
    animation: spin 15s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    width: calc(100% - 4rem);
}

.toast {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.dark .toast {
    background-color: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 49;
    transition: transform var(--transition-normal), opacity var(--transition-normal), background-color var(--transition-fast);
    transform: scale(0);
    opacity: 0;
}

#back-to-top.show {
    transform: scale(1);
    opacity: 1;
}

/* Theme Toggle Transitions for specific elements */
.dark-mode-transition {
    transition: var(--transition-theme);
}

/* Project Card Hover and Interactive Overlay */
.project-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .project-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Custom experience line marker animation */
.experience-marker {
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.experience-item:hover .experience-marker {
    transform: scale(1.25);
    border-color: var(--accent);
}
