/* --- Google Fonts Import (Fallback) --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');

/* --- Variables --- */
:root {
    --bg-gradient-start: #60028A; /* بنفش تیره */
    --bg-gradient-end: #190066;   /* سرمه ای */
    --text-main: #383838;         /* متن اصلی */
    --text-subtle: #5C5C5C;       /* متن کم رنگ */
    --button-primary: #1A1DFF;     /* آبی دکمه */
    --button-primary-hover: #1518D0; /* آبی تیره تر برای هاور */
    --accent-warning: #FF9800;    /* نارنجی هشدار */
    --accent-danger: #f44336;     /* قرمز هشدار */
    --accent-safe: #4CAF50;       /* سبز امن */
    --accent-safe-light: #4CAF5080; /* سبز روشن برای پس زمینه امن */
    --accent-warning-light: #FF980080; /* نارنجی روشن برای پس زمینه هشدار */
    --white: #FFFFFF;
    --light-gray: #f0f0f0;
    --border-color: #e0e0e0;
    --modal-overlay: rgba(0, 0, 0, 0.7); /* اورلی تیره تر برای مودال */
    --modal-blur: blur(8px);          /* افکت بوکه قوی تر */

    /* --- فونت ها --- */
    --font-primary: 'Dubai Medium', 'Vazirmatn', sans-serif; /* اول دبی، بعد وزیرمتن */
}

/* --- Font Definition --- */
@font-face {
    font-family: 'Dubai Medium';
    src: url('dubaimedium.woff') format('woff'); /* فونت در ریشه */
    font-weight: normal;
    font-style: normal;
}

/* --- General Styles --- */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    text-align: center;
    overflow-x: hidden; /* جلوگیری از اسکرول افقی */
    scroll-behavior: smooth; /* اسکرول نرم */
}

/* --- Header --- */
header {
    background-color: rgba(255, 255, 255, 0.85); /* کمی شفاف */
    backdrop-filter: blur(10px) saturate(1.5); /* بوکه و شفافیت */
    -webkit-backdrop-filter: blur(10px) saturate(1.5); /* برای سافاری */
    padding: 1rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* سایه قوی تر */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky; /* هدر ثابت */
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    height: 40px; /* اندازه لوگو */
    filter: brightness(0) saturate(100%) hue-rotate(180deg); /* برای اینکه رنگش با بکگراند هماهنگ بشه */
    opacity: 0.9;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bg-gradient-start); /* رنگ بنفش */
    letter-spacing: 0.5px;
}

header nav {
    display: flex;
    gap: 1.8rem; /* فاصله بیشتر بین آیتم های منو */
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

header nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative; /* برای خط زیر هاور */
    padding-bottom: 5px;
    transition: color 0.3s ease, transform 0.2s ease;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin: auto;
    background: var(--button-primary); /* آبی */
    transition: width .5s ease;
}

header nav a:hover {
    color: var(--button-primary);
    transform: translateY(-2px); /* کمی بالا بیاد */
}

header nav a:hover::after {
    width: 100%;
}

.extension-soon {
    background-color: var(--light-gray);
    color: var(--text-subtle);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    pointer-events: none;
    cursor: not-allowed;
    font-weight: 400;
    transition: none; /* انیمیشن هاور رو غیرفعال کن */
}
.extension-soon:hover {
     transform: none; /* انیمیشن بالا رفتن رو غیرفعال کن */
}


/* --- Main Content --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem; /* فضای بیشتر */
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 3rem; /* بزرگتر */
    color: var(--white); /* سفید برای کنتراست روی گرادیانت */
    margin-bottom: 1rem;
    line-height: 1.3;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* سایه متن */
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9); /* کمی شفاف */
    margin-bottom: 3rem; /* فاصله بیشتر */
    max-width: 600px;
    font-weight: 400;
}

#url-check-form {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    max-width: 600px; /* بزرگتر */
    margin-bottom: 2rem;
    background-color: rgba(255, 255, 255, 0.8); /* پس زمینه فرم */
    backdrop-filter: blur(5px); /* بوکه برای فرم */
    padding: 1.5rem;
    border-radius: 15px; /* گوشه های گردتر */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* سایه قوی تر */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#url-check-form:hover {
    transform: translateY(-5px); /* کمی بالا بیاد */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}


#url-input {
    flex-grow: 1;
    padding: 1rem 1.2rem; /* پدینگ بیشتر */
    border: 1px solid var(--border-color);
    border-radius: 10px; /* گردتر */
    font-size: 1.1rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#url-input:focus {
    border-color: var(--button-primary);
    box-shadow: 0 0 0 3px rgba(26, 29, 255, 0.2); /* افکت فوکوس آبی */
}

.check-button { /* کلاس دکمه اصلی */
    padding: 1rem 2rem; /* پدینگ بیشتر */
    border-radius: 10px; /* گردتر */
    background-color: var(--button-primary);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 12px rgba(26, 29, 255, 0.3); /* سایه آبی */
    border: none; /* حذف خط اصلی */
}

.check-button:hover {
    background-color: var(--button-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(26, 29, 255, 0.4);
}
.check-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 29, 255, 0.3);
}

.result-message {
    margin-top: 2rem; /* فاصله بیشتر */
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    font-size: 1.2rem; /* بزرگتر */
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s ease, background-color 0.3s ease, transform 0.3s ease;
    background-color: transparent;
    color: var(--text-main); /* رنگ اصلی متن */
    border: 1px solid transparent; /* برای جلوگیری از پرش */
}

.result-message.safe {
    background-color: var(--accent-safe-light);
    border-color: var(--accent-safe);
    color: var(--accent-safe);
    opacity: 1;
    transform: scale(1.05); /* کمی بزرگ بشه */
}

.result-message.warning {
    background-color: var(--accent-warning-light);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
    opacity: 1;
    transform: scale(1.05); /* کمی بزرگ بشه */
}

.suspicious-details {
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
    transform: translateY(10px); /* کمی پایین تر شروع بشه */
}

.suspicious-details.visible {
    opacity: 1;
    transform: translateY(0);
}

.suspicious-details .more-info-btn {
    background-color: var(--button-primary); /* آبی */
    box-shadow: 0 6px 12px rgba(26, 29, 255, 0.3);
}
.suspicious-details .more-info-btn:hover {
    background-color: var(--button-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(26, 29, 255, 0.4);
}
.suspicious-details .more-info-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 29, 255, 0.3);
}

/* --- Footer --- */
footer {
    background-color: rgba(20, 0, 102, 0.8); /* کمی شفاف تر از رنگ پس زمینه */
    color: var(--white);
    padding: 2rem 1rem;
    margin-top: auto;
    font-size: 0.95rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2); /* سایه از بالا */
}
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-content p {
    margin: 0;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay); /* پس زمینه تیره تر */
    backdrop-filter: var(--modal-blur); /* بوکه قوی تر */
    -webkit-backdrop-filter: var(--modal-blur);
    justify-content: center;
    align-items: center;
    opacity: 0; /* شروع با شفافیت صفر */
    transition: opacity 0.3s ease-out;
}

.modal.visible {
    opacity: 1; /* نمایش با شفافیت کامل */
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 30px; /* پدینگ بیشتر */
    border: none; /* حذف خط دور */
    width: 90%;
    max-width: 550px; /* عرض کمی بیشتر */
    border-radius: 15px; /* گوشه گردتر */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* سایه قوی تر */
    text-align: center;
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* انیمیشن ورود زیباتر */
    transform: scale(0.9); /* شروع کوچکتر */
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.modal.visible .modal-content { /* وقتی مودال visible میشه، محتوا هم انیمیت میشه */
    opacity: 1;
    transform: scale(1);
}

@keyframes modalFadeIn { /* انیمیشن ورود مودال */
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content h2 {
    color: var(--accent-warning); /* نارنجی */
    margin-top: 0;
    margin-bottom: 20px; /* فاصله بیشتر */
    font-size: 1.8rem;
}

.modal-content p {
    color: var(--text-main);
    font-size: 1.1rem; /* بزرگتر */
    line-height: 1.8; /* فاصله خطوط بیشتر */
    margin-bottom: 30px; /* فاصله بیشتر */
    text-align: justify;
}

.modal-content .more-info-btn { /* دکمه داخل مودال */
    background-color: var(--button-primary);
    box-shadow: 0 6px 12px rgba(26, 29, 255, 0.3);
}
.modal-content .more-info-btn:hover {
    background-color: var(--button-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(26, 29, 255, 0.4);
}
.modal-content .more-info-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 29, 255, 0.3);
}

.close-button {
    color: var(--text-subtle);
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 32px; /* بزرگتر */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    line-height: 1; /* تنظیم ارتفاع خط */
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-danger);
    transform: scale(1.1); /* کمی بزرگ بشه */
}

/* --- Responsive adjustments --- */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }
    .subtitle {
        font-size: 1.1rem;
    }
    #url-check-form {
        max-width: 500px;
    }
    .modal-content {
        width: 90%;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    .logo-container {
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }
    .logo-img {
        height: 35px;
    }
    .site-title {
        font-size: 1.6rem;
    }
    header nav {
        flex-direction: column;
        gap: 1rem;
        margin-top: 0;
    }
    header nav a {
        padding-bottom: 3px;
    }
    h1 {
        font-size: 2.2rem;
    }
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    #url-check-form {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        gap: 0.8rem;
    }
    #url-input, .check-button {
        width: 95%;
        max-width: 350px;
    }
    .result-message {
        font-size: 1.1rem;
        padding: 1rem;
        min-height: 40px;
    }
    footer {
        padding: 1.5rem 1rem;
    }
}
