/**
 * URL Encoder Tool Styles
 * Extends main.css with tool-specific styling
 */

.url-encoder-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

.textarea-wrapper {
    position: relative;
}

.url-textarea {
    width: 100%;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-color, #ffffff);
    color: var(--text-color, #1f2937);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--primary-color-alpha, rgba(59, 130, 246, 0.1));
}

.url-textarea::placeholder {
    color: var(--text-muted, #6b7280);
    opacity: 0.6;
}

.url-textarea[readonly] {
    background: var(--bg-secondary, #f9fafb);
    cursor: default;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.encode-btn,
.decode-btn,
.encode-component-btn,
.btn-swap,
.btn-copy,
.btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.encode-btn {
    background: var(--primary-color, #3b82f6);
    color: white;
    flex: 1;
}

.encode-btn:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.decode-btn {
    background: var(--secondary-color, #6366f1);
    color: white;
    flex: 1;
}

.decode-btn:hover {
    background: var(--secondary-dark, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.encode-component-btn {
    background: var(--info-color, #14b8a6);
    color: white;
    flex: 1;
}

.encode-component-btn:hover {
    background: var(--info-dark, #0f766e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-swap {
    background: var(--warning-color, #f59e0b);
    color: white;
}

.btn-swap:hover {
    background: var(--warning-dark, #d97706);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-copy {
    background: var(--success-color, #10b981);
    color: white;
}

.btn-copy:hover {
    background: var(--success-dark, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-clear {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-color, #1f2937);
    border: 2px solid var(--border-color, #e5e7eb);
}

.btn-clear:hover {
    background: var(--bg-tertiary, #e5e7eb);
    border-color: var(--text-muted, #6b7280);
}

/* Output Container */
.output-container {
    margin-top: 1rem;
}

.output-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

/* Info Box */
.info-box {
    padding: 1.25rem;
    background: var(--card-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    margin-top: 1rem;
}

.info-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

.info-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted, #6b7280);
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--success-color, #10b981);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }

    .encode-btn,
    .decode-btn,
    .encode-component-btn,
    .btn-swap,
    .btn-copy,
    .btn-clear {
        width: 100%;
    }

    .copy-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* Dark Theme Support - System Preference */
@media (prefers-color-scheme: dark) {
    .url-textarea {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .url-textarea[readonly] {
        background: #0f172a;
    }

    .info-box {
        background: #1e293b;
        border-color: #334155;
    }

    .info-title,
    .output-title,
    .input-label {
        color: #e2e8f0;
    }

    .info-text {
        color: #94a3b8;
    }

    .btn-clear {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .btn-clear:hover {
        background: #334155;
        border-color: #475569;
    }
}

/* Light Theme Specific (when explicitly set) */
[data-theme="light"] .url-textarea {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .url-textarea[readonly] {
    background: #f9fafb;
}

[data-theme="light"] .info-box {
    background: #f8f9fa;
    border-color: #e5e7eb;
}

[data-theme="light"] .info-title,
[data-theme="light"] .output-title,
[data-theme="light"] .input-label {
    color: #1f2937;
}

[data-theme="light"] .info-text {
    color: #6b7280;
}

[data-theme="light"] .btn-clear {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .btn-clear:hover {
    background: #e5e7eb;
    border-color: #6b7280;
}

/* Dark Theme Specific (when explicitly set) */
[data-theme="dark"] .url-textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .url-textarea[readonly] {
    background: #0f172a;
}

[data-theme="dark"] .info-box {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .info-title,
[data-theme="dark"] .output-title,
[data-theme="dark"] .input-label {
    color: #e2e8f0;
}

[data-theme="dark"] .info-text {
    color: #94a3b8;
}

[data-theme="dark"] .btn-clear {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-clear:hover {
    background: #334155;
    border-color: #475569;
}
