* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    padding: 15px;
    color: #334155;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
}

.header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 30px 20px;
    text-align: center;
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 120px;
}

.header-content {
    flex: 1;
}

.header-buttons {
    position: absolute;
    top: 25px;
    left: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.settings-btn,
.youtube-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 8px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
}

.youtube-btn {
    background: rgba(255, 0, 0, 0.8);
    font-size: 1.1rem;
}

.youtube-btn:hover {
    background: #ff0000;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.form {
    padding: 25px 20px;
}

.form-group {
    margin-bottom: 18px;
}

.label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
    font-size: 0.9rem;
}

.label i {
    margin-left: 8px;
    color: #059669;
    font-size: 1rem;
    width: 18px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.required {
    color: #dc2626;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #059669;
    color: white;
}

.btn-primary:hover {
    background: #047857;
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: #0ea5e9;
    color: white;
}

.btn-success:hover {
    background: #0284c7;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: #8b5cf6;
    color: white;
}

.btn-info:hover {
    background: #7c3aed;
}

.result-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    animation: slideInUp 0.5s ease-out;
}

.result-section h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
    color: #374151;
    font-weight: 600;
}

.result-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #64748b;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

.loading p {
    font-size: 1rem;
    font-weight: 500;
    animation: textPulse 2s ease-in-out infinite;
    margin: 0;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
    animation: fadeInButtons 0.6s ease-out;
}

.generated-prompt {
    background: #f9fafb;
    color: #374151;
    padding: 15px;
    border-radius: 6px;
    margin-top: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    white-space: pre-wrap;
    border: 1px solid #f3f4f6;
    animation: fadeInText 0.7s ease-out;
}

.hidden {
    display: none;
}

/* تحسينات للهواتف المحمولة */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 8px;
    }

    .header {
        padding: 25px 15px;
        min-height: 110px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header-buttons {
        top: 20px;
        left: 20px;
        gap: 10px;
    }

    .settings-btn,
    .youtube-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        padding: 6px;
    }

    .youtube-btn {
        font-size: 0.9rem;
    }

    .form {
        padding: 20px 15px;
    }

    .result-section {
        padding: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        width: 100%;
        padding: 12px 20px;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .header {
        padding: 20px 10px;
        min-height: 100px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .header p {
        font-size: 0.8rem;
    }

    .header-buttons {
        top: 15px;
        left: 15px;
        gap: 8px;
    }

    .settings-btn,
    .youtube-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        padding: 5px;
    }

    .youtube-btn {
        font-size: 0.8rem;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .header {
        padding: 35px 25px;
        min-height: 130px;
    }

    .header-buttons {
        top: 30px;
        left: 30px;
        gap: 15px;
    }

    .settings-btn,
    .youtube-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        padding: 10px;
    }

    .youtube-btn {
        font-size: 1.2rem;
    }
}

/* تحسين مظهر placeholder */
::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.textarea::placeholder {
    white-space: pre-line;
}

/* تحسين مظهر التمرير */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* تحسين focus للأزرار */
.btn:focus {
    outline: 2px solid rgba(5, 150, 105, 0.5);
    outline-offset: 2px;
}

/* تحسين حالة disabled للأزرار */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* تحسينات الوصولية */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInButtons {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تصميم الاقتراحات */
.suggestions {
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-btn {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #0ea5e9;
    color: white;
    transform: translateY(-1px);
}

.keyword-tag {
    display: inline-block;
    background: #f0fdf4;
    color: #15803d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 2px;
    cursor: pointer;
    border: 1px solid #bbf7d0;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: #22c55e;
    color: white;
    transform: translateY(-1px);
}

/* تصميم Modal الإعدادات */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.help-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
    display: block;
}

.help-text a {
    color: #059669;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* تصميم منطقة الرسائل */
.message-container {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 0;
    margin: 0;
}

.message-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: 0;
    animation: slideDown 0.3s ease-out;
    position: relative;
}

.message-icon {
    font-size: 1.1rem;
    margin-left: 10px;
    flex-shrink: 0;
}

.message-text {
    flex: 1;
    line-height: 1.4;
    white-space: pre-line;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    color: inherit;
    opacity: 0.7;
}

.message-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* أنواع الرسائل */
.message-error {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 3px solid #ef4444;
}

.message-success {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 3px solid #22c55e;
}

.message-warning {
    background: #fffbeb;
    color: #92400e;
    border-bottom: 3px solid #f59e0b;
}

.message-info {
    background: #eff6ff;
    color: #1e40af;
    border-bottom: 3px solid #3b82f6;
}

/* انيميشن الظهور */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* انيميشن الاختفاء */
@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

.message-fade-out {
    animation: slideUp 0.3s ease-in forwards;
}

/* تصميم الفوتر */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 25px 20px;
    margin-top: 30px;
    border-top: 3px solid #059669;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    flex: 1;
}

.copyright p {
    margin: 0;
    font-size: 0.9rem;
}

.copyright strong {
    color: #059669;
    font-weight: 600;
}

.subtitle {
    font-size: 0.8rem !important;
    opacity: 0.8;
    margin-top: 5px !important;
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-link.instagram:hover {
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
}

.social-link.telegram {
    background: linear-gradient(45deg, #0088cc, #229ED9);
}

.social-link.telegram:hover {
    box-shadow: 0 6px 20px rgba(34, 158, 217, 0.4);
}

.social-link.github {
    background: linear-gradient(45deg, #333, #24292e);
}

.social-link.github:hover {
    box-shadow: 0 6px 20px rgba(36, 41, 46, 0.4);
}

/* تجاوب الفوتر مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .copyright {
        order: 2;
    }

    .social-links {
        order: 1;
        justify-content: center;
    }

    .social-link {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 20px 15px;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}
