/* @font-face {
    font-family: 'Vazir';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.eot');
    src: url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.eot?#iefix') format('embedded-opentype'),
            url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.woff2') format('woff2'),
            url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.woff') format('woff'),
            url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
} */
@font-face {
  font-family: IRANSans;
  font-style: normal;
  font-weight: normal;
  src: url('/static/font/iransansdnweb.ttf') format('truetype');
}

 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: IRANSans;
    transition: background-color 0.5s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background: #0a0e29;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: 70px; /* فاصله برای navbar ثابت */
}

body.light-mode {
    background: #f0f2f5;
    color: #333;
}

/* نوار ناوبری */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 41, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(78, 84, 200, 0.3);
    z-index: 1000;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

body.light-mode .navbar {
    background: rgba(240, 242, 245, 0.9);
    border-bottom: 1px solid rgba(200, 200, 255, 0.5);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-left: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(to right, #4e54c8, #8f94fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .logo-text {
    background: linear-gradient(to right, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 0.5rem;
}

.nav-links a {
    color: #a0a7e6;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

body.light-mode .nav-links a {
    color: #5e6ebf;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(78, 84, 200, 0.2);
}

body.light-mode .nav-links a:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.nav-links a:hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #4e54c8;
    border-radius: 50%;
    box-shadow: 0 0 10px #4e54c8;
}

body.light-mode .nav-links a:hover::after {
    background: #2563eb;
    box-shadow: 0 0 10px #2563eb;
}

.nav-links a.active {
    color: #fff;
    background: rgba(78, 84, 200, 0.3);
}

body.light-mode .nav-links a.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.2);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: rgba(78, 84, 200, 0.2);
    border: none;
    width: 60px;
    height: 30px;
    border-radius: 25px;
    margin-left: 15px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 3px;
}

body.light-mode .theme-toggle {
    background: rgba(37, 99, 235, 0.2);
}

.theme-toggle::before {
    content: '☀️';
    position: absolute;
    left: 5px;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 1;
}

.theme-toggle::after {
    content: '🌙';
    position: absolute;
    right: 5px;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-thumb {
    width: 24px;
    height: 24px;
    background: #4e54c8;
    border-radius: 50%;
    position: absolute;
    transition: all 0.3s ease;
    left: 3px;
    z-index: 2;
}

body.light-mode .toggle-thumb {
    background: #2563eb;
    left: 33px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #8f94fb;
    margin: 2px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

body.light-mode .hamburger span {
    background: #2563eb;
}

/* ستاره های درخشان در پس زمینه */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

body.light-mode .stars {
    display: none;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.sun {
    position: fixed;
    top: 50px;
    right: 10%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffdd00, #ff9500);
    box-shadow: 0 0 50px #ff9500;
    z-index: -1;
    display: none;
}

body.light-mode .sun {
    display: block;
    animation: pulseSun 5s infinite alternate;
}

@keyframes pulseSun {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #4e54c8, #8f94fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(78, 84, 200, 0.5);
}

body.light-mode h1 {
    background: linear-gradient(to right, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.subtitle {
    color: #a0a7e6;
    font-size: 1.2rem;
}

body.light-mode .subtitle {
    color: #5e6ebf;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: rgba(13, 18, 48, 0.7);
    border: 1px solid #2a2f6b;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(78, 84, 200, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode .card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.1);
    color: #374151;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(78, 84, 200, 0.4);
}

body.light-mode .card:hover {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: rgba(78, 84, 200, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

body.light-mode .card-icon {
    background: rgba(37, 99, 235, 0.2);
}

.card-title {
    font-size: 1.3rem;
    color: #8f94fb;
}

body.light-mode .card-title {
    color: #2563eb;
}

.card-content {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 1.5rem 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

body.light-mode .card-content {
    color: #1f2937;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.card-footer {
    color: #a0a7e6;
    text-align: center;
    font-size: 0.9rem;
}

body.light-mode .card-footer {
    color: #6b7280;
}

/* بخش تصویر روز ناسا */
.apod-section {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(13, 18, 48, 0.7);
    border: 1px solid #2a2f6b;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(78, 84, 200, 0.2);
    backdrop-filter: blur(10px);
}

body.light-mode .apod-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.1);
}

.apod-header {
    text-align: center;
    margin-bottom: 2rem;
}

.apod-title {
    font-size: 1.8rem;
    color: #8f94fb;
    margin-bottom: 0.5rem;
}

body.light-mode .apod-title {
    color: #2563eb;
}

.apod-date {
    color: #a0a7e6;
    font-size: 1rem;
}

body.light-mode .apod-date {
    color: #6b7280;
}

.apod-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.apod-image-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.apod-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.apod-image:hover {
    transform: scale(1.02);
}

.apod-explanation {
    line-height: 1.8;
    text-align: justify;
    max-width: 800px;
}

.apod-loading {
    text-align: center;
    padding: 2rem;
    color: #8f94fb;
    font-size: 1.2rem;
}

body.light-mode .apod-loading {
    color: #2563eb;
}

.apod-error {
    text-align: center;
    padding: 2rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
}

.apod-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.apod-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.last-updated {
    text-align: center;
    margin-top: 2rem;
    color: #6b728c;
    font-size: 0.9rem;
}

body.light-mode .last-updated {
    color: #6b7280;
}

.loading {
    color: #8f94fb;
    text-align: center;
    font-size: 1.2rem;
}

body.light-mode .loading {
    color: #2563eb;
}

/* دکمه به‌روزرسانی */
.refresh-btn {
    display: block;
    margin: 2rem auto;
    padding: 0.8rem 2rem;
    background: linear-gradient(to right, #4e54c8, #8f94fb);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.light-mode .refresh-btn {
    background: linear-gradient(to right, #2563eb, #3b82f6);
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(78, 84, 200, 0.5);
}

body.light-mode .refresh-btn:hover {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}

/* سیاره چرخان */
.planet {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4e54c8, #1f2359);
    box-shadow: 0 0 30px #4e54c8;
    right: 10%;
    top: 20%;
    z-index: -1;
    animation: rotate 30s linear infinite;
}

body.light-mode .planet {
    display: none;
}

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

/* ابرهای شناور در حالت روز */
.cloud {
    position: fixed;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

body.light-mode .cloud {
    opacity: 1;
}

.cloud-1 {
    width: 200px;
    height: 60px;
    top: 20%;
    left: 5%;
    animation: floatCloud 20s infinite linear;
}

.cloud-2 {
    width: 150px;
    height: 45px;
    top: 30%;
    right: 10%;
    animation: floatCloud 25s infinite linear reverse;
}

.cloud-3 {
    width: 180px;
    height: 54px;
    bottom: 20%;
    left: 15%;
    animation: floatCloud 30s infinite linear;
}

@keyframes floatCloud {
    0% { transform: translateX(0); }
    50% { transform: translateX(50px); }
    100% { transform: translateX(0); }
}

/* رسپانسیو برای موبایل */
@media (max-width: 968px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        background: rgba(10, 14, 41, 0.95);
        backdrop-filter: blur(10px);
        width: 70%;
        height: calc(100vh - 70px);
        flex-direction: column;
        padding: 2rem;
        transition: all 0.5s ease;
        border-left: 1px solid rgba(78, 84, 200, 0.3);
    }
    
    body.light-mode .nav-links {
        background: rgba(240, 242, 245, 0.95);
        border-left: 1px solid rgba(200, 200, 255, 0.5);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .nav-links a {
        font-size: 1.2rem;
        padding: 1rem;
        display: block;
        text-align: center;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .sun {
        display: none !important;
    }
    
    .cloud {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .apod-section {
        padding: 1.5rem;
    }
    
    .apod-title {
        font-size: 1.5rem;
    }
    
    .planet {
        display: none;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}