/* ===========================================
   AI Tools Platform - الأنماط الرئيسية
=========================================== */

/* إعادة تعيين بعض الأنماط */
.aitp-tool-box * {
    box-sizing: border-box;
}

.aitp-tool-box {
    max-width: 800px;
    margin: 40px auto;
    padding: 35px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.aitp-tool-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0073ff, #00d4ff, #9c27b0, #ff9800);
    z-index: 1;
}

.aitp-tool-box h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #1a202c;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.aitp-tool-box h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #0073ff, #00d4ff);
    border-radius: 3px;
}

/* منطقة التحميل */
.aitp-upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 50px 30px;
    margin: 25px 0;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.aitp-upload-area:hover {
    border-color: #0073ff;
    background: #edf2f7;
    transform: translateY(-2px);
}

.aitp-upload-area.drag-over {
    border-color: #0073ff;
    background: #e6fffa;
    box-shadow: 0 0 0 3px rgba(0, 115, 255, 0.1);
}

.aitp-upload-area p {
    color: #4a5568;
    font-size: 16px;
    margin: 10px 0;
}

.aitp-upload-area .upload-icon {
    font-size: 60px;
    color: #0073ff;
    margin-bottom: 15px;
    display: block;
}

/* الإدخالات */
.aitp-tool-box input[type="text"],
.aitp-tool-box input[type="number"],
.aitp-tool-box input[type="url"],
.aitp-tool-box select,
.aitp-tool-box textarea {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
    color: #2d3748;
}

.aitp-tool-box input:focus,
.aitp-tool-box select:focus,
.aitp-tool-box textarea:focus {
    border-color: #0073ff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 115, 255, 0.1);
}

/* الأزرار */
.aitp-btn {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, #0073ff 0%, #005ad1 100%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 115, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.aitp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.aitp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 115, 255, 0.3);
    color: white;
}

.aitp-btn:hover::before {
    left: 100%;
}

.aitp-btn:active {
    transform: translateY(-1px);
}

.aitp-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1f7d34 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.aitp-btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #e68900 100%);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.2);
}

.aitp-btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

/* زر التحميل */
.aitp-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #28a745 0%, #1f7d34 100%);
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    margin-top: 25px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.aitp-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    color: white;
}

/* منطقة المعاينة */
.aitp-preview-area {
    margin: 25px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.aitp-preview-area img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* منطقة النتيجة */
.aitp-result-area {
    margin: 30px 0;
    padding: 30px;
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: none;
}

.aitp-result-area.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* مؤشر التحميل */
.aitp-loading {
    display: none;
    margin: 30px 0;
    padding: 25px;
    background: #f8fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    text-align: center;
}

.aitp-loading.active {
    display: block;
}

.aitp-loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top-color: #0073ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* أداة معطلة */
.aitp-disabled {
    padding: 25px;
    background: linear-gradient(135deg, #ffeaea 0%, #ffd6d6 100%);
    border: 2px solid #ffbaba;
    border-radius: 15px;
    color: #cc0000;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0;
}

/* ألوان الأدوات */
.color-picker {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-option.selected {
    border-color: #0073ff;
    transform: scale(1.05);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0073ff;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* QR Code و Barcode */
#aitp-qr-result,
#aitp-barcode-result {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

#aitp-qr-result canvas,
#aitp-barcode-result canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    padding: 15px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* أداة إزالة الخلفية */
#aitp-bg-preview {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

#aitp-bg-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    border-radius: 10px;
    z-index: 1;
    pointer-events: none;
}

#aitp-bg-preview img {
    position: relative;
    z-index: 2;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* أداة اللوجو */
.logo-preview {
    width: 300px;
    height: 200px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.logo-text {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, #0073ff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* شريط التقدم */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073ff, #00d4ff);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
}

/* رسائل التنبيه */
.aitp-alert {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.aitp-alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #c3e6cb;
    color: #155724;
}

.aitp-alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffeaa7;
    color: #856404;
}

.aitp-alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.aitp-alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 2px solid #bee5eb;
    color: #0c5460;
}

/* التجاوبية */
@media (max-width: 768px) {
    .aitp-tool-box {
        margin: 20px 15px;
        padding: 25px 20px;
    }
    
    .aitp-tool-box h2 {
        font-size: 24px;
    }
    
    .aitp-upload-area {
        padding: 30px 20px;
    }
    
    .aitp-btn,
    .aitp-download-btn {
        padding: 14px 24px;
        font-size: 16px;
        min-width: auto;
        width: 100%;
    }
    
    .logo-preview {
        width: 100%;
        height: 150px;
    }
    
    .logo-text {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .aitp-tool-box {
        padding: 20px 15px;
    }
    
    .aitp-tool-box h2 {
        font-size: 20px;
    }
    
    .color-option {
        width: 50px;
        height: 50px;
    }
    
    .aitp-alert {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* تأثيرات خاصة */
.tool-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
    background: linear-gradient(135deg, #0073ff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تلميحات */
.aitp-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.aitp-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    font-weight: normal;
}

.aitp-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* الفواصل */
.aitp-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 30px 0;
}

/* الأقسام */
.aitp-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.aitp-section h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}