@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600&family=Vazirmatn:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Fira Code', 'Vazirmatn', monospace;
    background: linear-gradient(135deg, #0a101f 0%, #121d33 50%, #1a273f 100%);
    color: #0dff9a;
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out;
}

#hacker-text {
    font-size: 4rem;
    color: #0dff9a;
    text-shadow: 0 0 10px rgba(13, 255, 154, 0.5);
    letter-spacing: 0.1em;
    font-family: 'Fira Code', monospace;
    direction: ltr;
    height: 80px;
    display: flex;
    align-items: center;
}

#cracking-status {
    margin-top: 20px;
    font-size: 1rem;
    color: #4ade80;
    font-family: 'Fira Code', monospace;
    min-height: 24px;
}

.glitch {
    animation: glitch 0.5s linear infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

/* Main Content */
#main-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease-out;
    flex: 1;
    width: 100%;
}

#main-content.show {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* RTL/LTR Support */
.rtl {
    direction: rtl;
    text-align: right;
}

.ltr {
    direction: ltr;
    text-align: left;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0 30px;
    position: relative;
    width: 100%;
}

.name {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(13, 255, 154, 0.7);
    font-family: 'Fira Code', monospace;
    direction: ltr;
    color: #0dff9a;
}

.title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: #4ade80;
    margin-bottom: 20px;
}

.ascii-art {
    font-size: 0.8rem;
    color: #22c55e;
    white-space: pre;
    margin: 20px 0;
    opacity: 0.7;
    font-family: 'Fira Code', monospace;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.nav-btn {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid #0dff9a;
    color: #0dff9a;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 255, 154, 0.1), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: rgba(13, 255, 154, 0.05);
    box-shadow: 0 0 10px rgba(13, 255, 154, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(13, 255, 154, 0.1);
    box-shadow: 0 0 15px rgba(13, 255, 154, 0.3);
}

/* Sections */
.section {
    display: none;
    margin-bottom: 40px;
    background: rgba(18, 29, 51, 0.7);
    border: 1px solid rgba(13, 255, 154, 0.2);
    border-radius: 10px;
    padding: 30px;
    backdrop-filter: blur(5px);
    position: relative;
    width: 100%;
}

.section.active {
    display: block;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.section h2 {
    color: #0dff9a;
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    font-family: 'Fira Code', monospace;
}

.section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0dff9a, transparent);
    margin: 10px auto;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.skill-category {
    background: rgba(18, 29, 51, 0.5);
    border: 1px solid rgba(13, 255, 154, 0.1);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: #0dff9a;
    box-shadow: 0 5px 15px rgba(13, 255, 154, 0.1);
    transform: translateY(-3px);
}

.skill-category h3 {
    color: #4ade80;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 4px 0;
    color: #a8b3c5;
    position: relative;
    padding-right: 18px;
    font-size: 0.9rem;
}

.skill-list li::before {
    content: '>';
    position: absolute;
    right: 0;
    color: #0dff9a;
    font-weight: bold;
}

/* Experience Cards */
.experience-card, .project-card {
    background: rgba(18, 29, 51, 0.5);
    border: 1px solid rgba(13, 255, 154, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.experience-card::before, .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #0dff9a, #4ade80);
}

.experience-card:hover, .project-card:hover {
    border-color: #0dff9a;
    box-shadow: 0 5px 20px rgba(13, 255, 154, 0.1);
    transform: translateX(-5px);
}

.card-title {
    color: #0dff9a;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.card-subtitle {
    color: #4ade80;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.card-description {
    color: #a8b3c5;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.contact-item {
    background: rgba(18, 29, 51, 0.5);
    border: 1px solid rgba(13, 255, 154, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.contact-item:hover {
    border-color: #0dff9a;
    box-shadow: 0 5px 15px rgba(13, 255, 154, 0.2);
    transform: translateY(-3px);
}

.contact-icon {
    font-size: 1.8rem;
    color: #0dff9a;
    margin-bottom: 8px;
}

/* Terminal Effect */
.terminal {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #0dff9a;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    margin: 15px 0;
}

.terminal-header {
    color: #0dff9a;
    margin-bottom: 8px;
    direction: ltr;
    text-align: left;
    font-size: 0.9rem;
}

.terminal-content {
    color: #4ade80;
    font-size: 0.9rem;
}

/* Icon styles */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 30px 0 20px;
    }
    
    .nav {
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    #hacker-text {
        font-size: 2.5rem;
    }
}