/* 
 * ملف التنسيقات الرئيسية
 * Main Stylesheet
 */

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: #333;
    line-height: 1.8;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Loading Screen ==================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Navigation ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    gap: 10px;
}

.nav-brand i {
    font-size: 28px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: 0.3s;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.nav-link i {
    font-size: 16px;
}

.nav-actions .btn-pdf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-actions .btn-pdf:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ==================== Main Content ==================== */
.main-content {
    padding-top: 80px;
}

.page-section {
    min-height: 100vh;
    padding: 80px 0;
    position: relative;
}

.page-section:nth-child(even) {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.page-section:nth-child(odd) {
    background: rgba(255, 255, 255, 0.4);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header i {
    font-size: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 40px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin: 0 auto;
    border-radius: 2px;
}

/* ==================== Home Page ==================== */
.home-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.home-text h1 {
    font-size: 60px;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-text .subtitle {
    font-size: 24px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 300;
}

.home-text .description {
    font-size: 18px;
    color: #777;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.home-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* ==================== About Section ==================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    text-align: center;
}

.about-image img {
    width: 100%;
    max-width: 350px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.about-image img:hover {
    transform: scale(1.05) rotate(2deg);
}

.about-text h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.about-text p {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.8;
}

.info-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: 0.3s;
}

.info-list li:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(-5px);
}

.info-list i {
    color: var(--primary-color);
    font-size: 18px;
}

.info-list strong {
    color: #333;
    min-width: 80px;
}

/* ==================== Skills Section ==================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.skill-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.3);
}

.skill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.skill-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.skill-name i {
    font-size: 24px;
    color: var(--skill-color, var(--primary-color));
}

.skill-percentage {
    font-size: 20px;
    font-weight: 700;
    color: var(--skill-color, var(--primary-color));
}

.skill-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--skill-color, var(--primary-color)) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 2s ease;
    width: 0;
}

.skill-card.animated .skill-progress {
    width: var(--skill-width);
}

/* ==================== Experience & Education ==================== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    padding: 0 50px;
}

.timeline-item:nth-child(odd) {
    text-align: right;
    padding-left: 50%;
    padding-right: 50px;
}

.timeline-item:nth-child(even) {
    text-align: left;
    padding-right: 50%;
    padding-left: 50px;
}

.timeline-icon {
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.timeline-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.timeline-date {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.timeline-content h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.timeline-content h4 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.timeline-content p {
    color: #666;
    line-height: 1.8;
}

/* ==================== Portfolio ==================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.portfolio-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.portfolio-audio {
    width: 100%;
    padding: 20px;
}

.portfolio-poem {
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-poem pre {
    font-family: var(--font-family);
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 2;
    color: #333;
}

.portfolio-info {
    padding: 20px;
}

.portfolio-info h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.portfolio-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.portfolio-link:hover {
    gap: 12px;
}

/* ==================== Languages ==================== */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.language-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.language-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.language-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.language-card h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
}

.language-level {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.language-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 2s ease;
    width: 0;
}

.language-card.animated .language-progress {
    width: var(--lang-width);
}

/* ==================== Achievements ==================== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.achievement-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.achievement-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.achievement-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.achievement-header h3 {
    font-size: 20px;
    color: #333;
    flex: 1;
}

.achievement-date {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.achievement-card p {
    color: #666;
    line-height: 1.8;
}

/* ==================== Footer ==================== */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
}

/* ==================== Scroll to Top ==================== */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: 0.3s;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        right: 30px;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-right: 70px;
        padding-left: 0;
        text-align: right;
    }
    
    .timeline-icon {
        right: 5px;
        transform: none;
    }
}

@media (max-width: 768px) {
    .home-text h1 {
        font-size: 40px;
    }
    
    .home-text .subtitle {
        font-size: 20px;
    }
    
    .section-header h2 {
        font-size: 32px;
    }
    
    .info-list {
        grid-template-columns: 1fr;
    }
    
    .home-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==================== Custom Animations ==================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== Enhanced Styling ==================== */
.card, .portfolio-card, .certificate-card, .achievement-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover, .portfolio-card:hover, .certificate-card:hover, .achievement-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Focus styles */
button:focus, 
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Enhanced buttons */
.btn, button, .nav-actions .btn-pdf {
    position: relative;
    overflow: hidden;
}

.btn::before, button::before, .nav-actions .btn-pdf::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before, button:hover::before, .nav-actions .btn-pdf:hover::before {
    width: 300px;
    height: 300px;
}

/* Print styles */
@media print {
    .navbar, .footer, .scroll-top-btn {
        display: none;
    }
    
    .page-section {
        page-break-inside: avoid;
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}