/* URL Encoder & Decoder Styling */

/* Textarea Styling */
.url-textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    tab-size: 2;
    resize: vertical;
}

/* Modern Mode Selector */
.mode-selector-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 0;
}

.mode-option {
    position: relative;
}

.mode-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.mode-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mode-icon .fsvg {
    opacity: 0.6;
    transition: all 0.3s ease;
}

.mode-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.mode-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* Hover State */
.mode-label:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mode-label:hover .mode-icon {
    background: #e8edf3;
}

.mode-label:hover .mode-icon .fsvg {
    opacity: 0.8;
}

/* Checked State */
.mode-input:checked + .mode-label {
    border-color: #052c65;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.1), inset 0 0 0 1px rgba(5, 44, 101, 0.1);
    transform: translateY(0);
}

.mode-input:checked + .mode-label .mode-icon {
    background: #052c65;
}

.mode-input:checked + .mode-label .mode-icon .fsvg {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.mode-input:checked + .mode-label .mode-title {
    color: #052c65;
}

.mode-input:checked + .mode-label .mode-desc {
    color: #475569;
}

/* Dark Mode */
[data-bs-theme="dark"] .mode-label {
    background: #1a1d23;
    border-color: #343a40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .mode-icon {
    background: #2d3239;
}

[data-bs-theme="dark"] .mode-title {
    color: #e9ecef;
}

[data-bs-theme="dark"] .mode-desc {
    color: #9ca3af;
}

[data-bs-theme="dark"] .mode-label:hover {
    border-color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .mode-label:hover .mode-icon {
    background: #3a3f47;
}

[data-bs-theme="dark"] .mode-input:checked + .mode-label {
    border-color: #6ea8fe;
    background: #212529;
    box-shadow: 0 2px 8px rgba(110, 168, 254, 0.2), inset 0 0 0 1px rgba(110, 168, 254, 0.2);
}

[data-bs-theme="dark"] .mode-input:checked + .mode-label .mode-icon {
    background: #6ea8fe;
}

[data-bs-theme="dark"] .mode-input:checked + .mode-label .mode-title {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .mode-input:checked + .mode-label .mode-desc {
    color: #9ca3af;
}

/* Statistics Container */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

[data-bs-theme="dark"] .stats-container {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .stat-label {
    color: #9ca3af;
}

[data-bs-theme="dark"] .stat-value {
    color: #e9ecef;
}

/* Status Message */
#statusMessage {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#statusContent {
    margin-bottom: 0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}

/* Alert Colors */
.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

[data-bs-theme="dark"] .alert-success {
    background-color: #0f5132;
    border-color: #146c43;
    color: #d1e7dd;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #842029;
    border-color: #a52834;
    color: #f8d7da;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #055160;
    border-color: #087990;
    color: #cff4fc;
}

/* Button Styling */
.toolBtn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
}

.toolBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.toolBtn:active {
    transform: translateY(0);
}

/* Swap Button - Custom Style */
.btn-swap {
    background-color: transparent;
    border: 1px solid #052c65;
    color: #052c65;
}

.btn-swap .fsvg {
    filter: none;
}

.btn-swap:hover {
    background-color: #052c65;
    border-color: #052c65;
    color: #ffffff;
}

.btn-swap:hover .fsvg {
    filter: brightness(0) invert(1);
}

.btn-swap:focus,
.btn-swap:active {
    background-color: #041f4d;
    border-color: #041f4d;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(5, 44, 101, 0.25);
}

.btn-swap:focus .fsvg,
.btn-swap:active .fsvg {
    filter: brightness(0) invert(1);
}

[data-bs-theme="dark"] .btn-swap {
    border-color: #6ea8fe;
    color: #6ea8fe;
}

[data-bs-theme="dark"] .btn-swap:hover {
    background-color: #6ea8fe;
    border-color: #6ea8fe;
    color: #000000;
}

[data-bs-theme="dark"] .btn-swap:hover .fsvg {
    filter: none;
}

[data-bs-theme="dark"] .btn-swap:focus,
[data-bs-theme="dark"] .btn-swap:active {
    background-color: #548cd4;
    border-color: #548cd4;
    color: #000000;
}

/* Encoding Options */
#encodingOptions {
    transition: all 0.3s ease;
}

/* Form Controls Dark Mode */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .url-textarea {
    background-color: #212529;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .url-textarea:focus {
    background-color: #212529;
    border-color: #86b7fe;
    color: #e9ecef;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #495057;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #6ea8fe;
    border-color: #6ea8fe;
}

/* Form Check Label Colors */
#encodingOptions .form-check-label {
    color: #212529;
}

[data-bs-theme="dark"] #encodingOptions .form-check-label {
    color: #e9ecef;
}

/* Ensure form labels have proper color */
.form-group label {
    color: #212529;
}

[data-bs-theme="dark"] .form-group label {
    color: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mode-selector-modern {
        grid-template-columns: 1fr;
    }

    .mode-label {
        padding: 14px;
    }

    .mode-icon {
        width: 44px;
        height: 44px;
    }

    .mode-title {
        font-size: 15px;
    }

    .mode-desc {
        font-size: 12px;
    }

    .stats-container {
        gap: 10px;
        padding: 10px;
    }

    .stat-item {
        min-width: 100px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 16px;
    }

    .toolBtn {
        width: 100%;
        margin-bottom: 5px;
    }

    .url-textarea {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .mode-selector-modern {
        gap: 12px;
    }

    .mode-label {
        padding: 12px;
        gap: 10px;
    }

    .mode-icon {
        width: 40px;
        height: 40px;
    }

    .mode-icon img {
        width: 20px;
        height: 20px;
    }
}

/* Loading Animation */
.toolBtn.loading {
    position: relative;
    pointer-events: none;
}

.toolBtn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Focus States */
.url-textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Placeholder Styling */
.url-textarea::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

[data-bs-theme="dark"] .url-textarea::placeholder {
    color: #9ca3af;
    opacity: 0.8;
}
