/* General Styles */
body {
    font-family: 'Vazirmatn', sans-serif; /* فونت فارسی شیک‌تر */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #eef2f5; /* رنگ پس‌زمینه روشن‌تر */
    color: #34495e;
    direction: rtl; /* برای پشتیبانی از زبان فارسی */
    text-align: right; /* برای راست چین کردن متن */
    line-height: 1.6;
}

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-Variable-font-face.css');


.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo img {
    height: 60px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #1abc9c;
    bottom: -5px;
    right: 0;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: #1abc9c;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 50px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(27, 188, 156, 0.1) 0%, transparent 70%);
    animation: pulse-bg 15s infinite alternate;
}

@keyframes pulse-bg {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.hero h1 {
    font-size: 3.8em;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hero h1 .highlight {
    color: #1abc9c;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.4em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.btn {
    display: inline-block;
    background-color: #1abc9c;
    color: #fff;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(27, 188, 156, 0.4);
    position: relative;
    z-index: 1;
}

.btn:hover {
    background-color: #16a085;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(27, 188, 156, 0.6);
}

/* AI Features Section */
.ai-features {
    padding: 60px 0;
    text-align: center;
}

.ai-features h2 {
    font-size: 3em;
    margin-bottom: 50px;
    color: #2c3e50;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.ai-features h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: #1abc9c;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    text-align: right;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-right: 5px solid #1abc9c; /* خط رنگی در سمت راست */
    opacity: 0; /* برای انیمیشن */
    transform: translateY(20px); /* برای انیمیشن */
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.feature-item h3 {
    color: #34495e;
    font-size: 2em;
    margin-bottom: 15px;
}

.feature-item p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 25px;
    color: #555;
}

.btn-small {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 10px 22px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-small:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Chat Page Specific Styles */
.chat-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    min-height: 600px; /* حداقل ارتفاع برای چت باکس و فرم */
}

.chat-box {
    flex-grow: 1; /* چت باکس فضای موجود را پر می‌کند */
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fcfcfc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth; /* اسکرول نرم */
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: fade-in-up 0.3s ease-out; /* انیمیشن ورود پیام */
}

.user-message {
    background-color: #dcf8c6;
    align-self: flex-end;
    text-align: right;
    border-bottom-right-radius: 5px; /* گوشه تیز در سمت ارسال کننده */
}

.copilot-message {
    background-color: #e2e2e2;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 5px; /* گوشه تیز در سمت ارسال کننده */
}

.message .sender {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    color: #444;
    font-size: 0.9em;
}

.message p {
    margin: 5px 0;
    font-size: 1.05em;
    color: #333;
}

.message .timestamp {
    font-size: 0.7em;
    color: #888;
    text-align: right;
    display: block;
    margin-top: 8px;
}

.user-message .timestamp {
    text-align: left;
}

.copilot-message .timestamp {
    text-align: right;
}

.no-message {
    text-align: center;
    color: #777;
    padding: 20px;
    font-style: italic;
}

.chat-form {
    display: flex;
    gap: 15px;
    padding-top: 10px;
}

.chat-form input[type="text"] {
    flex-grow: 1;
    padding: 12px 20px;
    border: 1px solid #ccc;
    border-radius: 25px; /* گردتر */
    font-size: 1.1em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chat-form input[type="text"]:focus {
    border-color: #1abc9c;
    box-shadow: 0 0 8px rgba(27, 188, 156, 0.3);
}

.chat-form button {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px; /* گردتر */
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.chat-form button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.chat-form button:active {
    transform: translateY(0);
}

.error-message {
    background-color: #ffe6e6; /* رنگ روشن‌تر برای خطا */
    color: #d9534f;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    display: none; /* به صورت پیش فرض مخفی */
    animation: fade-in 0.3s ease-out;
}

/* Footer */
footer {
    background-color: #34495e;
    color: #e0e0e0;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    text-align: right;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    padding: 10px;
}

.footer-section h3 {
    color: #1abc9c;
    margin-bottom: 20px;
    font-size: 1.8em;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: #1abc9c;
    bottom: 0;
    right: 0;
}

.footer-section p, .footer-section ul {
    font-size: 1em;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #1abc9c;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #4a627a;
    padding-top: 25px;
    font-size: 0.9em;
    color: #bbb;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


.animated-fade-in {
    animation: fade-in 1s ease-out forwards;
}

.animated-scale-in {
    animation: scale-in 0.8s ease-out 0.5s forwards; /* با تاخیر */
}

/* برای نمایش متوالی آیتم های ویژگی */
.animated-slide-up:nth-child(1) { animation: slide-up 0.6s ease-out 0.2s forwards; }
.animated-slide-up:nth-child(2) { animation: slide-up 0.6s ease-out 0.4s forwards; }
.animated-slide-up:nth-child(3) { animation: slide-up 0.6s ease-out 0.6s forwards; }
.animated-slide-up:nth-child(4) { animation: slide-up 0.6s ease-out 0.8s forwards; }
/* می توانید این الگو را برای تعداد بیشتری از آیتم ها ادامه دهید */


/* Responsive adjustments */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        margin-top: 15px;
    }

    nav ul li {
        margin: 10px 0;
    }

    .hero {
        padding: 70px 20px;
    }

    .hero h1 {
        font-size: 2.8em;
    }

    .hero p {
        font-size: 1.2em;
    }

    .ai-features h2 {
        font-size: 2.5em;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 25px;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .chat-container {
        padding: 20px;
    }
}
/* استایل بخش تغییر چهره */
.face-swap-section {
    padding: 40px 0;
}

.face-swap-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 300px;
    max-height: 300px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 5px;
}

.result-container {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 10px;
}

.result-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 5px;
    margin: 15px 0;
}

.loading {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.btn {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    margin: 10px 5px;
    transition: background 0.3s;
}

.btn:hover {
    background: #45a049;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}
@media (max-width: 480px) {
    .hero {
        padding: 50px 15px;
    }

    .hero h1 {
        font-size: 2.2em;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-form button {
        width: 100%;
        margin-top: 10px;
    }

    .message {
        max-width: 95%;
    }
}