/* Redirect Checker Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: #f8fafc;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    min-height: 5rem;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.title-section p {
    font-size: 0.875rem;
    color: #6b7280;
}

.actions {
    display: flex;
    gap: 0.75rem;
}

/* Main Content */
.main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card Styles */
.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-header h2,
.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-ghost:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Form Styles */
.url-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.url-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.url-input input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

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

.url-input input:invalid {
    border-color: #ef4444;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.waiting {
    background: #9ca3af;
}

.status-dot.ready {
    background: #10b981;
}

.status-dot.analyzing {
    background: #f59e0b;
    animation: pulse 2s infinite;
}

.status-dot.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress Bar */
.progress-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 0.75rem;
    background: #f3f4f6;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 0.375rem;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-primary { color: #6366f1; }
.stat-green { color: #10b981; }
.stat-yellow { color: #f59e0b; }
.stat-blue { color: #3b82f6; }
.stat-red { color: #ef4444; }

/* Help Panel */
.help-panel {
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.help-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.help-panel ul {
    margin: 0 0 1rem 1.5rem;
    color: #374151;
}

.help-panel li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.tip {
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #1e40af;
}

/* Results Guide */
.guide {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.guide h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.guide-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.guide-item div {
    font-size: 0.875rem;
    line-height: 1.6;
}

.guide-item strong {
    color: #111827;
    font-weight: 600;
}

.performance-guide,
.status-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.performance-guide span,
.status-guide span {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.perf-excellent,
.status-success {
    background: #dcfce7;
    color: #166534;
}

.perf-good {
    background: #fef3c7;
    color: #92400e;
}

.perf-slow,
.status-error {
    background: #fecaca;
    color: #991b1b;
}

.status-redirect {
    background: #dbeafe;
    color: #1e40af;
}

.benchmark {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
}

.benchmark h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
}

.benchmark ul {
    margin: 0;
    padding-left: 1.25rem;
}

.benchmark li {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #1e40af;
    line-height: 1.5;
}

/* Results Table */
.results-section {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-count {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.results-table th {
    background: #f9fafb;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.results-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.results-table tbody tr:hover {
    background: #f9fafb;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Step column */
.step-number {
    width: 3rem;
    height: 1.5rem;
    background: #6366f1;
    color: white;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.step-final {
    background: #10b981;
}

/* URL column */
.url-cell {
    max-width: 300px;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #e5e7eb;
}

/* Status code styling */
.status-200 { color: #10b981; font-weight: 600; }
.status-301, .status-302, .status-303, .status-307, .status-308 { color: #3b82f6; font-weight: 600; }
.status-400, .status-404 { color: #f59e0b; font-weight: 600; }
.status-500, .status-502, .status-503 { color: #ef4444; font-weight: 600; }
.status-error, .status-loop, .status-max { color: #ef4444; font-weight: 600; }

/* Redirect type badges */
.redirect-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.redirect-301, .redirect-308 {
    background: #dcfce7;
    color: #166534;
}

.redirect-302, .redirect-303, .redirect-307 {
    background: #dbeafe;
    color: #1e40af;
}

.redirect-none {
    background: #f3f4f6;
    color: #6b7280;
}

.redirect-error, .redirect-loop {
    background: #fecaca;
    color: #991b1b;
}

/* Response time */
.response-time {
    font-weight: 500;
}

.response-fast { color: #10b981; }
.response-medium { color: #f59e0b; }
.response-slow { color: #ef4444; }

/* Headers preview */
.headers-preview {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.error-content svg {
    color: #ef4444;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
}

.error-content p {
    margin: 0;
    color: #7f1d1d;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem 0;
    }
    
    .url-input {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .results-table {
        font-size: 0.75rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .url-cell {
        max-width: 150px;
        font-size: 0.7rem;
    }
    
    .guide-item {
        flex-direction: column;
        text-align: center;
    }
    
    .performance-guide,
    .status-guide {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 0.7rem;
    }
}

/* Contact Form Styles */
#contact-form-container {
    position: relative;
    overflow: hidden;
}

#contact-form-iframe {
    transition: height 0.3s ease;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}