/* ================= Tool Container (Unified Style) ================= */
.qr-tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ================= Header ================= */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.tool-header p {
    color: var(--footer-text);
    font-size: 0.95rem;
}

/* ================= Workspace (Vertical) ================= */
.tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ================= Input Section ================= */
.tool-input-section {
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.tool-input-section textarea,
.custom-select {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 16px;
    /* يمنع زوم الآيفون */
    transition: 0.3s;
    font-family: inherit;
}

.tool-input-section textarea {
    min-height: 100px;
    /* مستطيل نحيف */
    resize: vertical;
}

.tool-input-section textarea:focus,
.custom-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Custom Color Pickers */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 10px;
    gap: 10px;
    transition: 0.3s;
}

.color-picker-wrapper:focus-within {
    border-color: var(--primary-color);
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker-wrapper span {
    font-family: monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Buttons */
.action-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 5px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: var(--hover-color);
}

.action-btn.success {
    width: 50%;
    background: var(--primary-color);
    color: white;
    margin-top: 15px;
}

.action-btn.success:hover {
    background: var(--hover-color);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ================= Output Section ================= */
.tool-output-section {
    display: flex;
    justify-content: center;
    /* توسيط نتيجة الـ QR في المنتصف */
}

.qr-result-card {
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    /* عرض أصغر للصندوق ليكون التركيز على الـ QR */
}

.image-wrapper {
    width: 250px;
    height: 250px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-color);
    transition: 0.3s;
}

.image-wrapper.empty {
    border-color: var(--border-color);
}

.image-wrapper.loaded {
    border: 2px solid var(--primary-color);
    padding: 10px;
    background: white;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#qr-placeholder-text {
    color: var(--footer-text);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* ================= Mobile Adjustments ================= */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    /* وضع الألوان تحت بعضها في الشاشات الصغيرة جداً */
}