/**
 * Enhanced CSS Styles
 * أنماط CSS المحسنة
 */

/* ==================== Scroll Progress Bar ==================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 10000;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.2s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ==================== Custom Tooltips ==================== */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10001;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Reveal Animations ==================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Enhanced Cards ==================== */
.skill-card,
.timeline-card,
.portfolio-card {
    position: relative;
    overflow: hidden;
}

.skill-card::before,
.timeline-card::before,
.portfolio-card::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, 50%);
    left: var(--mouse-x, 50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    pointer-events: none;
}

.skill-card:hover::before,
.timeline-card:hover::before,
.portfolio-card:hover::before {
    width: 400px;
    height: 400px;
}

/* ==================== Notifications System ==================== */
.notifications-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification i {
    font-size: 20px;
}

.notification-success {
    border-right: 4px solid #10b981;
}

.notification-success i {
    color: #10b981;
}

.notification-error {
    border-right: 4px solid #ef4444;
}

.notification-error i {
    color: #ef4444;
}

.notification-warning {
    border-right: 4px solid #f59e0b;
}

.notification-warning i {
    color: #f59e0b;
}

.notification-info {
    border-right: 4px solid #3b82f6;
}

.notification-info i {
    color: #3b82f6;
}

.notification-close {
    margin-right: auto;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}

.notification-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ==================== Theme Switcher ==================== */
.theme-toggle {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

/* Dark Theme Styles */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #eaeaea;
    --card-bg: #16213e;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: var(--text-color);
}

[data-theme="dark"] .navbar {
    background: rgba(22, 33, 62, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-link {
    color: #eaeaea;
}

[data-theme="dark"] .page-section {
    background: rgba(22, 33, 62, 0.5);
}

[data-theme="dark"] .skill-card,
[data-theme="dark"] .timeline-card,
[data-theme="dark"] .portfolio-card {
    background: rgba(22, 33, 62, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

[data-theme="dark"] .section-header h2,
[data-theme="dark"] h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
}

/* ==================== Loading States ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Form Validation ==================== */
.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    animation: shake 0.3s ease;
}

input.error,
textarea.error,
select.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==================== Enhanced Hover Effects ==================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* ==================== Glassmorphism Effect ==================== */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

[data-theme="dark"] .glass {
    background: rgba(22, 33, 62, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==================== Gradient Text ==================== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Animated Background ==================== */
.animated-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== Floating Elements ==================== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ==================== Pulse Animation ==================== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ==================== Shimmer Effect ==================== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* ==================== Responsive Improvements ==================== */
@media (max-width: 768px) {
    .notifications-container {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .theme-toggle {
        bottom: 80px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .custom-tooltip {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ==================== Print Optimizations ==================== */
@media print {
    .theme-toggle,
    .notifications-container,
    .scroll-progress {
        display: none !important;
    }
    
    .page-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ==================== Accessibility Improvements ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==================== Performance Optimizations ==================== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}