/**
 * Premium AI Tools Styling — 100 أداة برو
 */
.ai-workspace {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 50px;
    min-height: 500px;
}

.ai-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
    z-index: 0;
}

.ai-container {
    position: relative;
    z-index: 1;
    padding: 40px;
    color: #fff;
}

/* Header */
.ai-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 40px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.status-dot.online {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

/* Cards */
.ai-glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.ai-field {
    margin-bottom: 24px;
}

.ai-field label {
    display: block;
    margin-bottom: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.ai-textarea,
.ai-input,
.ai-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 16px 20px;
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.ai-textarea {
    min-height: 140px;
    resize: none;
    overflow-y: auto;
}

.ai-textarea.sm {
    min-height: 80px;
}

.ai-textarea:focus,
.ai-input:focus,
.ai-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.ai-input-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 10px;
}

.char-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.ai-icon-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-icon-btn:hover {
    color: #6366f1;
    transform: scale(1.1);
}

/* Buttons */
.ai-actions {
    margin-top: 30px;
}

.ai-generate-btn {
    width: 100%;
    position: relative;
    padding: 18px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-weight: 900;
    font-size: 1.15rem;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
}

.ai-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.ai-btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.ai-generate-btn:hover .ai-btn-glow {
    opacity: 1;
}

/* Result Area */
.ai-result-section {
    margin-top: 40px;
    display: none;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-result-header .h-l {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.ai-result-header .success-icon {
    color: #10b981;
    width: 20px;
}

.ai-result-header .h-r {
    display: flex;
    gap: 10px;
}

.ai-copy-btn,
.ai-download-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ai-result-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.ai-output-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre-wrap;
    text-align: justify;
}

/* Image Output */
.ai-output-image {
    display: none;
}

.image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-wrapper:hover .img-overlay {
    opacity: 1;
}

.overlay-btn {
    background: #fff;
    color: #000;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
}

/* Result Footer */
.ai-result-footer {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Loading */
.ai-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

.ai-brain-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.ai-brain-loader .core {
    position: absolute;
    inset: 20px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 50%;
    filter: blur(15px);
    animation: pulse 1.5s ease-in-out infinite;
}

.ai-brain-loader .ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #a855f7;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Grid Layouts */
.ai-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ai-translate-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 20px;
    align-items: center;
}

.ai-translate-grid .full {
    grid-column: span 3;
}

.ai-translate-swap {
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-container {
        padding: 20px;
    }

    .ai-glass-card {
        padding: 25px;
    }

    .ai-form-grid,
    .ai-translate-grid {
        grid-template-columns: 1fr;
    }

    .ai-translate-grid .full {
        grid-column: span 1;
    }

    .ai-translate-swap {
        transform: rotate(90deg);
    }
}

/* Upload zone */
.ai-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.ai-upload-zone:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon-wrap {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #6366f1;
}

.ai-hidden {
    display: none;
}