/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-black: #0a0a0a;
    --secondary-black: #1a1a1a;
    --dark-gray: #2a2a2a;
    --orange: #ff6b35;
    --orange-dark: #e55a2b;
    --orange-light: #ff8c5a;
    --text-light: #e0e0e0;
    --text-gray: #a0a0a0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--primary-black);
    color: var(--text-light);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Image loading states */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.profile-img,
.about-img {
    transition: opacity 0.3s ease;
    background: var(--dark-gray);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-img[src=""],
.about-img[src=""] {
    opacity: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(255, 107, 53, 0.1);
    z-index: 1000;
}

.navbar-toggler {
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(255, 107, 53, 0.2);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    color: var(--orange) !important;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-badge {
    animation: fadeInUp 0.8s ease;
}

.badge-custom {
    background: rgba(255, 107, 53, 0.2);
    color: var(--orange);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 107, 53, 0.3);
    display: inline-block;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.6s both;
}

.btn-primary-custom {
    background: var(--orange);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-custom:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    color: var(--orange);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid var(--orange);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-custom:hover {
    background: var(--orange);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

.social-links {
    animation: fadeInUp 1s ease 0.8s both;
}

.social-link {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: rgba(255, 107, 53, 0.1);
    color: var(--orange);
    border-radius: 50%;
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: var(--orange);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
}

.hero-image {
    position: relative;
    animation: fadeInRight 1s ease 0.5s both;
}

.image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(255, 107, 53, 0.3);
    animation: float 6s ease-in-out infinite;
    overflow: hidden;
    border: 5px solid rgba(255, 107, 53, 0.3);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.1);
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 0;
    right: 0;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    bottom: 0;
    left: 0;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 10%;
    animation-delay: 4s;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-down {
    color: var(--orange);
    font-size: 2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.scroll-down:hover {
    color: var(--orange-light);
    transform: translateY(5px);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   Section Styles
   ============================================ */
.section-padding {
    padding: 100px 0;
}

.bg-dark-section {
    background-color: var(--secondary-black);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
    margin: 0 auto;
    border-radius: 2px;
}

.text-orange {
    color: var(--orange) !important;
}

/* ============================================
   About Section
   ============================================ */
.about-image {
    position: relative;
}

.image-card {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--secondary-black) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.image-card:hover {
    transform: translateY(-10px);
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.about-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.about-content p {
    color: var(--text-gray);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ============================================
   Skills Section
   ============================================ */
.skill-card {
    background: var(--dark-gray);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 53, 0.1);
    height: 100%;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--orange);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
}

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--orange);
}

.skill-card h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.skill-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag {
    background: rgba(255, 107, 53, 0.1);
    color: var(--orange);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

/* ============================================
   Projects Section
   ============================================ */
.project-card {
    background: var(--dark-gray);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 53, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
    border-color: var(--orange);
}

.project-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--orange);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 107, 53, 0.2);
}

.project-card:hover .project-icon {
    background: var(--orange);
    color: white;
    transform: scale(1.1) rotate(5deg);
    border-color: var(--orange);
}

.project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.project-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.project-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-form {
    margin-top: 2rem;
}

.form-control-custom {
    width: 100%;
    padding: 1rem;
    background: var(--dark-gray);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 10px;
    color: var(--text-light);
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    background: var(--secondary-black);
}

.form-control-custom::placeholder {
    color: var(--text-gray);
}

.contact-info {
    padding: 2rem;
}

.contact-info i {
    font-size: 2.5rem;
    color: var(--orange);
    margin-bottom: 1rem;
}

.contact-info h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.contact-info p {
    color: var(--text-gray);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--primary-black);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 107, 53, 0.1);
}

.footer p {
    color: var(--text-gray);
    margin: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-stats {
        flex-direction: row;
        justify-content: space-around;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .stat-item {
        flex: 1;
        min-width: 120px;
    }
    
    .hero-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .profile-image {
        width: 250px;
        height: 250px;
    }
    
    .image-wrapper {
        height: 400px;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    .social-link {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 1rem;
    }
    
    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item h4 {
        font-size: 2rem;
    }
    
    .skill-card {
        padding: 2rem;
    }
    
    .project-icon {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .contact-info {
        padding: 1.5rem;
    }
    
    .contact-info i {
        font-size: 2rem;
    }
    
    .navbar-nav {
        text-align: right;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .btn-primary-custom,
    .btn-outline-custom {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
    
    .image-wrapper {
        height: 300px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .about-content h3 {
        font-size: 1.5rem;
    }
    
    .about-content p {
        font-size: 1rem;
    }
    
    .image-card {
        height: 300px;
    }
    
    .skill-card {
        padding: 1.5rem;
    }
    
    .skill-card h4 {
        font-size: 1.2rem;
    }
    
    .project-content h4 {
        font-size: 1.1rem;
    }
    
    .project-content p {
        font-size: 0.9rem;
    }
    
    .form-control-custom {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 0.9rem;
        margin-left: 0.3rem;
        margin-right: 0.3rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .section-padding {
        padding: 50px 0;
    }
    
    .contact-info {
        padding: 1rem;
    }
    
    .contact-info h5 {
        font-size: 1rem;
    }
    
    .contact-info p {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .image-wrapper {
        height: 250px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .stat-item h4 {
        font-size: 1.8rem;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 100px 0 50px;
    }
    
    .image-wrapper {
        height: 300px;
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
}

/* Container improvements for mobile */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Ensure images don't break layout */
.project-img,
.about-img,
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fix for navbar collapse on mobile */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: rgba(10, 10, 10, 0.98);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 10px;
        border: 1px solid rgba(255, 107, 53, 0.2);
    }
}

/* Tablet specific styles */
@media (min-width: 577px) and (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .profile-image {
        width: 280px;
        height: 280px;
    }
    
    .image-wrapper {
        height: 450px;
    }
    
    .about-stats {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .stat-item {
        flex: 1;
    }
}

/* Large tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .profile-image {
        width: 280px;
        height: 280px;
    }
    
    .image-wrapper {
        height: 450px;
    }
}

