/* Tool UI Base Styles */
.tool-ui-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
    .tool-ui-container {
        padding: 1rem;
        border-radius: 12px;
        margin: 0 1rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }

    .tool-ui-header {
        margin-bottom: 1.5rem;
    }

    .tool-ui-header h2 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .tool-ui-header p {
        font-size: 0.85rem;
    }
}

.tool-ui-header {
    margin-bottom: 2rem;
    text-align: center;
}

.tool-ui-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-ui-header p {
    color: var(--text-secondary);
}

/* Base Inputs */
.tool-textarea {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: var(--transition);
    margin-bottom: 1rem;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

@media (max-width: 640px) {
    .tool-textarea {
        min-height: 160px;
        font-size: 15px; /* Prevents zoom on iOS */
        border-radius: 10px;
        padding: 0.75rem;
        margin-bottom: 0.875rem;
    }
}

.tool-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.tool-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 48px;
}

@media (max-width: 640px) {
    .tool-input {
        font-size: 15px; /* Prevents zoom on iOS */
        border-radius: 10px;
        padding: 0.75rem;
    }
}

.tool-input:focus {
    border-color: var(--accent-color);
}

/* Tool Buttons / Controls */
.tool-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tool-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
    .tool-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .tool-btn:active {
        transform: scale(0.98);
    }

    .tool-controls {
        gap: 0.625rem;
        margin-bottom: 0.875rem;
    }
}

.tool-btn i {
    width: 16px;
    height: 16px;
}

.tool-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.tool-btn.primary {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

.tool-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Result Box / Stats */
.tool-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-right: 0.5rem;
    z-index: 2;
    gap: 1rem;
}

@media (max-width: 640px) {
    .tool-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* -----------------------------
   FILE UPLOAD UI STYLES
----------------------------- */

.file-upload-wrapper {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2rem;
}

.file-upload-wrapper:hover,
.file-upload-wrapper.dragover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.1);
    box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.2);
}

.file-upload-wrapper.dragover {
    transform: scale(1.02);
}

.privacy-notice {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    opacity: 0.8;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.file-upload-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.file-list {
    text-align: left;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.file-item i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.file-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading Overlay */
.processing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.processing-overlay.active {
    display: flex;
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.processing-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.stat-box {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-box .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Password Generator Specific */
.password-display {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    gap: 1rem;
}

@media (max-width: 640px) {
    .password-display {
        padding: 0.875rem 1rem;
    }

    .password-display input {
        font-size: 1.25rem;
    }
}

.password-display input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: monospace;
    font-weight: 600;
    outline: none;
}

.settings-group {
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .settings-group {
        margin-bottom: 1.25rem;
    }

    .settings-group label {
        font-size: 0.95rem;
    }
}

.settings-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.range-slider {
    width: 100%;
    margin-top: 0.5rem;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 4px;
    outline: none;
    touch-action: manipulation;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.range-slider::-moz-range-thumb:active {
    transform: scale(1.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--text-primary);
}

.checkbox-label:hover {
    border-color: var(--accent-color);
}