/* URL Parser & Query String Analyzer - Custom Styles */

/* Tool-specific animations */
@keyframes urlPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* URL input field enhancements */
.url-input-enhanced {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    position: relative;
}

.url-input-enhanced:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.url-input-enhanced.valid {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.url-input-enhanced.invalid {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Component cards */
.component-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.component-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.component-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.component-card:hover::before {
    opacity: 1;
}

/* Operation buttons */
.operation-btn {
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.operation-btn:hover {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

.operation-btn.active {
    background-color: #3b82f6 !important;
    color: white !important;
}

.operation-btn.active:hover {
    background-color: #2563eb !important;
    color: white !important;
}

/* Analysis scores */
.score-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    position: relative;
    background: conic-gradient(from 0deg, #ef4444 0%, #f59e0b 30%, #10b981 70%, #10b981 100%);
    padding: 3px;
}

.score-ring::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: white;
}

.score-ring .score-text {
    position: relative;
    z-index: 1;
}

.score-excellent {
    background: conic-gradient(from 0deg, #10b981 0%, #10b981 100%);
}

.score-good {
    background: conic-gradient(from 0deg, #10b981 0%, #10b981 70%, #f59e0b 100%);
}

.score-warning {
    background: conic-gradient(from 0deg, #f59e0b 0%, #f59e0b 70%, #ef4444 100%);
}

.score-poor {
    background: conic-gradient(from 0deg, #ef4444 0%, #ef4444 100%);
}

/* Parameter tables */
.param-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.param-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.param-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.param-table tr:hover {
    background: #f9fafb;
}

.param-table .param-key {
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.param-table .param-value {
    font-family: "SF Mono", Consolas, Monaco, monospace;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
}

/* URL components visualization */
.url-breakdown {
    font-family: "SF Mono", Consolas, Monaco, monospace;
    background: #1f2937;
    color: white;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
}

.url-breakdown .scheme {
    color: #f59e0b;
}
.url-breakdown .host {
    color: #10b981;
}
.url-breakdown .port {
    color: #8b5cf6;
}
.url-breakdown .path {
    color: #06b6d4;
}
.url-breakdown .query {
    color: #f87171;
}
.url-breakdown .fragment {
    color: #fbbf24;
}

/* Action buttons */
.action-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.action-btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.action-btn.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.action-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Responsive design */
@media (max-width: 768px) {
    .component-card {
        margin-bottom: 16px;
    }

    .param-table {
        font-size: 12px;
    }

    .param-table th,
    .param-table td {
        padding: 8px;
    }

    .url-breakdown {
        font-size: 12px;
        padding: 12px;
    }

    .score-ring {
        width: 50px;
        height: 50px;
        font-size: 12px;
    }

    .action-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Syntax highlighting for JSON output */
.json-viewer {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 13px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.json-viewer .json-key {
    color: #fbbf24;
}

.json-viewer .json-string {
    color: #10b981;
}

.json-viewer .json-number {
    color: #8b5cf6;
}

.json-viewer .json-boolean {
    color: #f87171;
}

.json-viewer .json-null {
    color: #6b7280;
}

/* Copy button for code blocks */
.copy-container {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Advanced features toggle */
.feature-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #3b82f6;
}

.toggle-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active::before {
    transform: translateX(20px);
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}
