* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; 
}

:root {
    --font-primary: 'Vazirmatn', sans-serif;
    --font-secondary: 'Lalezar', cursive;
    
    --bg-color: #0f172a;
    --main-color: #38bdf8;
    --text-color: #ffffff;
    --panel-bg: rgba(15, 23, 42, 0.95);
    --panel-text: #ffffff;
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.2);

    
}

h1, h2, h3, h4, h5, h6 {
    font-size: 2rem !important; 
    color: var(--main-color);
    transition: color 0.3s ease;
}

p,label {
    font-size: 1rem !important;
    color: var(--text-color);
}

body {
    font-family: var(--font-primary);
    
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
}


.music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--main-color);
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--main-color);
    transition: all 0.3s ease;
}

.music-btn:hover {
    box-shadow: 0 0 25px var(--main-color);
    transform: scale(1.05);
}
body.light-theme .music-btn:hover {
    box-shadow: 0 0 25px var(--main-color);
    transform: scale(1.05);
}

#music-icon {
    font-size: 20px;
    transition: all 0.3s;
}

.music-btn.playing #music-icon {
    color: #fff;
    animation: glitch-anim 2s infinite linear alternate-reverse;
    text-shadow: 2px 2px #ff00c1, -2px -2px var(--main-color);
}

@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}


.settings-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    direction: ltr;
}

.settings-toggle {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle i {
    animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.settings-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--main-color);
    border-color: var(--main-color);
}

.settings-toggle:hover i {
    animation-duration: 1s;
}
body.light-theme .settings-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--main-color);
    border-color: var(--main-color);
}

body.light-theme .settings-toggle:hover i {
    animation-duration: 1s;
}


.settings-panel {
    position: absolute;
    top: 60px;
    left: 0;
    width: 250px;
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 20px;
    color: var(--panel-text);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-panel h3 {
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid var(--input-border);
    padding-bottom: 10px;
    text-align: center;
    color: var(--main-color);
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #ccc;
}


.setting-item select, 
.setting-item input[type="color"] {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--panel-text);
    outline: none;
    cursor: pointer;
    font-family: var(--font-primary); 
    transition: all 0.3s ease;
}

.setting-item select {
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    padding-right: 35px; 
    position: relative;
    
    background-image: linear-gradient(45deg, transparent 50%, var(--panel-text) 50%),
                      linear-gradient(135deg, var(--panel-text) 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(1em + 0px),
                         calc(100% - 10px) calc(1em + 0px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.setting-item select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.setting-item select option {
    background-color: var(--bg-color);
    color: var(--panel-text);
    padding: 10px;
}

.setting-item input[type="color"] {
    height: 42px; 
    padding: 2px;
}

.setting-item input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--main-color); 
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
body.light-theme .setting-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--main-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
body.light-theme {
    --bg-color: #f1f5f9;
    /* --main-color: #2563eb;  */
    --text-color: #1e293b; 
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-text: #334155;   
    --input-bg: #ffffff;    
    --input-border: #cbd5e1;
}


body.light-theme .settings-panel {
    background: var(--panel-bg) ;
    border: 1px solid var(--input-border) ;
    color: var(--panel-text) ;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-panel h3 {
    color: var(--main-color);
    border-bottom-color: var(--input-border);
}

body.light-theme .setting-item label {
    color: #64748b;
}

body.light-theme .setting-item select,
body.light-theme .setting-item input[type="color"] {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);}

body.light-theme .setting-item select {
    background-image: linear-gradient(45deg, transparent 50%, var(--text-color) 50%),
                      linear-gradient(135deg, var(--text-color) 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(1em + 0px),
                         calc(100% - 10px) calc(1em + 0px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

body.light-theme .setting-item select option {
    background-color: #fff;
    color: #333;
}

body.light-theme .setting-item input[type="range"] {
    background: #e2e8f0; 
}

body.light-theme .setting-item input[type="range"]::-webkit-slider-thumb,
body.light-theme .setting-item input[type="range"]::-moz-range-thumb {
    background: var(--main-color);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.light-theme .settings-toggle {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
body.light-theme .settings-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--main-color);
    border-color: var(--main-color);
}



body.light-theme .music-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--main-color);
    color: var(--main-color);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

body.light-theme .music-btn:hover {
    background: #fff;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

body.light-theme .content header,
body.light-theme .content section {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}













.hero-section {
    min-height: 100vh; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1; 
    padding: 20px;
}

.glass-card {
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    border-color: var(--main-color);
}
body.light-theme .glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    border-color: var(--main-color);
}


.profile-img-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px auto;
    position: relative;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--main-color); 
    box-shadow: 0 0 20px var(--main-color); 
    transition: transform 0.3s ease;
}

.glass-card:hover .profile-img {
    transform: scale(1.05) rotate(3deg);
}
body.light-theme .glass-card:hover .profile-img {
    transform: scale(1.05) rotate(3deg);
}

.name {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.job-title {
    font-size: 1.1rem;
    color: var(--main-color); 
    font-weight: 500;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn:hover {
    background: var(--main-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
body.light-theme .social-btn:hover {
    background: var(--main-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
     color: #fff;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

body.light-theme .glass-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body.light-theme .name {
    color: var(--text-color);
}

body.light-theme .social-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}











.about-section {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.about-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: var(--main-color);
}
body.light-theme .about-card:hover {
    transform: translateY(-5px);
    border-color: var(--main-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.section-header i {
    font-size: 24px;
    color: var(--main-color);
}

.section-header h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 0;
}

.divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--main-color), transparent);
    margin: 15px 0 30px 0;
    opacity: 0.7;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e2e8f0;
    margin-bottom: 15px;
    text-align: justify;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tag {
    background: rgba(56, 189, 248, 0.1);
    color: var(--main-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--main-color);
    color: #fff;
    transform: scale(1.05);
}

body.light-theme .about-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    transition: all 0.3s ease;
}

body.light-theme .section-header h2 {
    color: var(--text-color);
}

body.light-theme .about-content p {
    color: #475569;
}

body.light-theme .tag {
    background: rgba(37, 99, 235, 0.1);
    /* color: #2563eb; */
    color: var(--main-color);

    border-color: rgba(37, 99, 235, 0.2);
}

body.light-theme .tag:hover {
    background: var(--main-color);
    color: #fff;
    transform: scale(1.05);
}















.skills-section {
    padding: 40px 20px 80px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.skills-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.skill-box {
    width: 100%;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.skill-percentage {
    font-size: 0.95rem;
    color: var(--main-color);
    font-weight: 700;
}

.progress-line {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    display: block;
    height: 100%;
    border-radius: 10px;
    background: var(--main-color);
    width: 0;
    position: relative;
    box-shadow: 0 0 10px var(--main-color);
    
    transition: width 1.5s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

body.light-theme .skills-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-theme .skill-name {
    color: var(--text-color);
}

body.light-theme .progress-line {
    background: rgba(0, 0, 0, 0.1);
}



.portfolio-section {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.portfolio-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.portfolio-item {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}
body.light-theme .portfolio-item:hover {
    transform: translateY(-5px);
}


.portfolio-img {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-img img {
    transform: scale(1.1);
}
body.light-theme .portfolio-item:hover .portfolio-img img {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    bottom: -100%; 
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.portfolio-item:hover .overlay {
    bottom: 0;
}
body.light-theme .portfolio-item:hover .overlay {
    bottom: 0;
}

.overlay h3 {
    color: var(--main-color);
    font-size: 1.4rem;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.overlay p {
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s; 
}

.btn-view {
    padding: 10px 25px;
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s, background 0.3s, color 0.3s;
}

.btn-view:hover {
    background: var(--main-color);
    color: #fff;
}
body.light-thme .btn-view:hover {
    background: var(--main-color);
    color: #fff;
}
.portfolio-item:hover .overlay h3,
.portfolio-item:hover .overlay p,
.portfolio-item:hover .btn-view {
    transform: translateY(0);
}
body.light-theme .portfolio-item:hover .overlay h3,
body.light-theme .portfolio-item:hover .overlay p,
body.light-theme .portfolio-item:hover .btn-view {
    transform: translateY(0);
}


body.light-theme .portfolio-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-theme .overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-theme .overlay h3 {
    color: var(--main-color);
}

body.light-theme .overlay p {
    color: #475569;
}







.footer-section {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    margin-top: auto; 
}

.footer-content {
    width: 100%;
    max-width: 1000px; 
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-color);
    
    color: var(--text-color);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-content a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

.footer-content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}