/**
 * All-in-One Tools Hub - Tool Interface Styles
 * Styles for individual tool UIs: inputs, outputs, buttons,
 * drag-and-drop, calculator, QR code, JSON formatter, image tools,
 * password generator, color picker.
 */

/* ============================================
   1. TOOL LAYOUT
   ============================================ */
.aiot-tool-interface { padding: 1.5rem 0; }

.aiot-tool-input-section { margin-bottom: 1.5rem; }

.aiot-tool-output-section { margin-top: 1.5rem; }

.aiot-tool-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .aiot-tool-row--split {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   2. TEXT INPUT AREAS
   ============================================ */
.aiot-text-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    font-size: 0.9375rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    line-height: 1.7;
    color: #1e293b;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aiot-text-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.aiot-text-input--dark {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

.aiot-text-input--dark:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

/* Label */
.aiot-input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

/* Text options (case converter, etc.) */
.aiot-text-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.aiot-option-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aiot-option-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.aiot-option-btn.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* ============================================
   3. OUTPUT / RESULT AREAS
   ============================================ */
.aiot-output-area {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    min-height: 80px;
}

.aiot-output-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}

.aiot-output-content {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.aiot-output-content--dark {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

/* Stats grid (word count, char count, etc.) */
.aiot-output-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.aiot-stat-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.aiot-stat-box-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #6366f1;
}

.aiot-stat-box-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   4. TOOL ACTION BUTTONS (v10.0.0 - Redesigned)
   ============================================ */
.aiot-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.aiot-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    line-height: 1;
}

.aiot-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.aiot-action-btn:hover::before {
    opacity: 1;
}

/* Process Button - Gradient with glow */
.aiot-action-btn--process {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.aiot-action-btn--process:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.aiot-action-btn--process:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Clear Button */
.aiot-action-btn--clear {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.aiot-action-btn--clear:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

/* Copy Button - Green with icon animation */
.aiot-action-btn--copy {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border-color: #a7f3d0;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.12);
}

.aiot-action-btn--copy:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border-color: #059669;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    transform: translateY(-2px);
}

.aiot-action-btn--copy:active {
    transform: translateY(0);
}

.aiot-action-btn--copy.copied {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border-color: #059669;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.aiot-action-btn--copy .aiot-btn-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aiot-action-btn--copy:hover .aiot-btn-icon {
    transform: scale(1.15);
}

.aiot-action-btn--copy.copied .aiot-btn-icon {
    animation: aiot-copyPulse 0.4s ease;
}

@keyframes aiot-copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(-8deg); }
    100% { transform: scale(1); }
}

/* Download Button - Blue with icon animation */
.aiot-action-btn--download {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.aiot-action-btn--download:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

.aiot-action-btn--download:active {
    transform: translateY(0);
}

.aiot-action-btn--download .aiot-btn-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aiot-action-btn--download:hover .aiot-btn-icon {
    transform: translateY(2px);
    animation: aiot-downloadBounce 0.6s ease infinite;
}

@keyframes aiot-downloadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Button icon */
.aiot-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.aiot-btn-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Disabled state */
.aiot-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   5. FILE UPLOAD & DRAG-AND-DROP
   ============================================ */
.aiot-file-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.aiot-file-upload-zone:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.aiot-file-upload-zone.dragover {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.aiot-file-upload-zone input[type="file"] { display: none; }

.aiot-upload-icon {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    transition: color 0.2s ease;
}

.aiot-file-upload-zone:hover .aiot-upload-icon { color: #6366f1; }

.aiot-upload-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
}

.aiot-upload-hint {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.aiot-upload-hint span {
    color: #6366f1;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* File list after upload */
.aiot-file-list { margin-top: 1rem; }

.aiot-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.aiot-file-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef2ff;
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.aiot-file-item-info { flex: 1; min-width: 0; }

.aiot-file-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiot-file-item-size {
    font-size: 0.75rem;
    color: #94a3b8;
}

.aiot-file-item-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    transition: color 0.15s;
}

.aiot-file-item-remove:hover { color: #dc2626; }

/* ============================================
   6. CALCULATOR
   ============================================ */
.aiot-calculator {
    max-width: 400px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: #0f172a;
}

.aiot-calc-display {
    padding: 1.5rem 1.25rem 1rem;
    text-align: right;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.aiot-calc-expression {
    font-size: 0.875rem;
    color: #64748b;
    font-family: 'SF Mono', Consolas, monospace;
    min-height: 1.25rem;
    margin-bottom: 0.25rem;
}

.aiot-calc-result {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f8fafc;
    font-family: 'SF Mono', Consolas, monospace;
    line-height: 1.2;
    overflow-x: auto;
}

.aiot-calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    padding: 1px;
    background: #1e293b;
}

.aiot-calc-btn {
    padding: 1.25rem 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: #334155;
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.1s ease;
}

.aiot-calc-btn:hover { background: #475569; }
.aiot-calc-btn:active { background: #1e293b; }

.aiot-calc-btn--operator {
    background: #4f46e5;
    color: #fff;
}

.aiot-calc-btn--operator:hover { background: #4338ca; }

.aiot-calc-btn--equals {
    background: #06b6d4;
    color: #fff;
}

.aiot-calc-btn--equals:hover { background: #0891b2; }

.aiot-calc-btn--clear {
    background: #dc2626;
    color: #fff;
}

.aiot-calc-btn--clear:hover { background: #b91c1c; }

.aiot-calc-btn--span2 { grid-column: span 2; }

/* ============================================
   7. QR CODE
   ============================================ */
.aiot-qr-container { text-align: center; }

.aiot-qr-preview {
    display: inline-block;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 1.25rem 0;
}

.aiot-qr-preview canvas,
.aiot-qr-preview img {
    max-width: 280px;
    max-height: 280px;
    display: block;
}

.aiot-qr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.aiot-qr-option {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.aiot-qr-option label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.aiot-qr-option input {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* ============================================
   8. JSON FORMATTER / VALIDATOR
   ============================================ */
.aiot-json-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .aiot-json-layout { grid-template-columns: 1fr 1fr; }
}

.aiot-json-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.aiot-json-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.aiot-json-status--valid {
    background: #dcfce7;
    color: #166534;
}

.aiot-json-status--invalid {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   9. IMAGE TOOL AREAS
   ============================================ */
.aiot-image-canvas-area {
    position: relative;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.aiot-image-canvas-area img,
.aiot-image-canvas-area canvas {
    max-width: 100%;
    max-height: 500px;
    display: block;
    border-radius: 4px;
}

.aiot-image-preview {
    max-width: 100%;
    max-height: 400px;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.aiot-image-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.aiot-image-dimensions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.aiot-image-dimensions label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.aiot-image-dimensions input {
    width: 100px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
}

.aiot-image-dimensions .separator {
    font-size: 1.25rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ============================================
   10. PASSWORD GENERATOR
   ============================================ */
.aiot-password-output {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.aiot-password-field {
    flex: 1;
    padding: 1rem;
    font-size: 1.125rem;
    font-family: 'SF Mono', Consolas, monospace;
    text-align: center;
    letter-spacing: 2px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aiot-password-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.aiot-password-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.aiot-password-option:hover { background: #f1f5f9; }

.aiot-password-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.aiot-password-option label {
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    font-weight: 500;
}

.aiot-password-length {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.aiot-password-length input[type="range"] {
    flex: 1;
    height: 6px;
    accent-color: #6366f1;
    cursor: pointer;
}

.aiot-password-length-value {
    min-width: 40px;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #6366f1;
}

/* Strength meter */
.aiot-strength-meter {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.aiot-strength-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.aiot-strength-bar--weak   { width: 25%; background: #ef4444; }
.aiot-strength-bar--fair   { width: 50%; background: #f59e0b; }
.aiot-strength-bar--good   { width: 75%; background: #22c55e; }
.aiot-strength-bar--strong { width: 100%; background: #059669; }

.aiot-strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   11. COLOR PICKER
   ============================================ */
.aiot-color-picker-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.aiot-color-swatch-area {
    flex: 1;
    min-width: 200px;
}

.aiot-color-picker-native {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
}

.aiot-color-picker-native::-webkit-color-swatch-wrapper { padding: 0; }
.aiot-color-picker-native::-webkit-color-swatch { border: none; border-radius: 12px; }
.aiot-color-picker-native::-moz-color-swatch { border: none; border-radius: 12px; }

.aiot-color-preview-swatch {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    margin-top: 0.75rem;
}

.aiot-color-values {
    flex: 1;
    min-width: 220px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.aiot-color-value-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.aiot-color-value-item label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
}

.aiot-color-value-item .aiot-color-val {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.875rem;
    color: #1e293b;
    background: transparent;
    border: none;
    text-align: right;
    width: auto;
    cursor: pointer;
}

/* ============================================
   12. CONVERTER TOOLS
   ============================================ */
.aiot-converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
    align-items: end;
}

.aiot-converter-grid,
.aiot-converter-from,
.aiot-converter-to {
    min-width: 0;
}

.aiot-converter-grid .aiot-form-group {
    overflow: visible;
}

.aiot-converter-grid .aiot-form-group label,
.aiot-converter-field label {
    line-height: 1.45;
    overflow: visible;
    white-space: normal;
}

.aiot-converter-grid .aiot-unit-select,
.aiot-converter-grid .aiot-value-input,
.aiot-converter-grid .aiot-value-output,
.aiot-converter-field select,
.aiot-converter-field input,
.aiot-converter-output {
    line-height: 1.5;
    min-height: 48px;
}

@media (max-width: 640px) {
    .aiot-converter-grid { grid-template-columns: 1fr; }
}

.aiot-converter-field {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.aiot-converter-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aiot-converter-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: #fff;
    margin-bottom: 0.75rem;
}

.aiot-converter-field input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.aiot-converter-field input:focus {
    outline: none;
    border-color: #6366f1;
}

.aiot-converter-output {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 8px;
    border: none;
}

.aiot-swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    align-self: center;
}

.aiot-swap-btn:hover {
    background: #4f46e5;
    transform: rotate(180deg);
}

/* ============================================
   13. TABS (tool sub-sections)
   ============================================ */
.aiot-tool-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.aiot-tool-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.aiot-tool-tab:hover { color: #6366f1; }

.aiot-tool-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.aiot-tool-tab-panel { display: none; }
.aiot-tool-tab-panel.active { display: block; animation: aiot-fadeIn 0.3s ease; }

/* ============================================
   14. NOTIFICATIONS & TOOLTIPS
   ============================================ */
.aiot-tool-notice {
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.aiot-tool-notice--success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.aiot-tool-notice--error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.aiot-tool-notice--info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.aiot-tool-notice--warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }

/* ============================================
   15. RESULTS BAR (v10.0.0 - New attractive bar with buttons)
   ============================================ */
.aiot-results-inner {
    animation: aiot-fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes aiot-fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.aiot-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.aiot-results-bar__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aiot-results-bar__title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #0ea5e9, #0284c7);
    border-radius: 2px;
}

.aiot-results-bar__actions {
    display: flex;
    gap: 8px;
}

/* Attractive Copy & Download buttons in results bar */
.aiot-copy-btn,
.aiot-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.aiot-copy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.aiot-copy-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.aiot-copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25);
}

.aiot-copy-btn--copied,
.aiot-copy-btn.copied {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
}

.aiot-download-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.aiot-download-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.aiot-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.25);
}

/* Ripple effect on click */
.aiot-copy-btn::after,
.aiot-download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.aiot-copy-btn:active::after,
.aiot-download-btn:active::after {
    width: 120px;
    height: 120px;
    opacity: 0;
}

/* Stats grid in results */
.aiot-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.aiot-stat-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.aiot-stat-box:hover {
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    transform: translateY(-1px);
}

.aiot-stat-box__value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: #4f46e5;
    font-family: 'SF Mono', Consolas, monospace;
}

.aiot-stat-box__value small {
    display: block;
    font-size: 0.6875rem;
    color: #6366f1;
    font-weight: 600;
    margin-top: 2px;
}

.aiot-stat-box__label {
    display: block;
    font-size: 0.6875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 500;
}

/* Results content */
.aiot-results-content {
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Notification */
.aiot-notification {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

.aiot-notification--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================
   16. SPINNER / LOADING
   ============================================ */
.aiot-spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 12px;
}

.aiot-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: aiot-spin 0.8s linear infinite;
}

.aiot-spinner-wrapper span {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* ============================================
   17. RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .aiot-calculator { max-width: 100%; }

    .aiot-calc-btn { padding: 1rem 0.5rem; font-size: 1.125rem; }
    .aiot-calc-result { font-size: 2rem; }

    .aiot-file-upload-zone { padding: 1.5rem 1rem; }

    .aiot-password-output { flex-direction: column; }

    .aiot-converter-grid {
        gap: 1rem;
        align-items: stretch;
    }

    .aiot-converter-swap {
        display: flex;
        justify-content: center;
    }

    .aiot-swap-btn { transform: rotate(90deg); align-self: center; margin: 0 auto; }
    .aiot-swap-btn:hover { transform: rotate(270deg); }
    
    /* Results bar responsive */
    .aiot-results-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        border-radius: 12px;
        padding: 14px;
    }
    
    .aiot-results-bar__actions {
        width: 100%;
    }
    
    .aiot-copy-btn,
    .aiot-download-btn {
        flex: 1;
        justify-content: center;
        padding: 9px 12px;
    }
    
    .aiot-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
