/* Redirect Checker - Fully Responsive with Day/Night Mode */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ====================== REDIRECT CHECKER STYLES ====================== */

.redirect-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: 'Poppins', sans-serif;
}

.redirect-wrapper {
    max-width: 920px;
    margin: 0 auto;
}

.redirect-title {
    font-size: 2.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.redirect-icon {
    font-size: 2.6rem;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.redirect-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.redirect-card {
    background: var(--surface);
    border-radius: var(--radius, 16px);
    border: 1px solid var(--border);
    padding: 2.2rem;
    box-shadow: var(--shadow);
}

/* Tabs */
.redirect-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.redirect-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.95rem;
}

.redirect-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.redirect-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Sections */
.redirect-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.redirect-section.active {
    display: block;
}

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

/* Input Fields */
.redirect-input,
.redirect-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1.05rem;
    background: var(--bg);
    color: var(--text);
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.redirect-textarea {
    min-height: 140px;
    resize: vertical;
}

.redirect-input:focus,
.redirect-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Action Buttons */
.redirect-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
}

.redirect-btn {
    padding: 0.85rem 1.8rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s;
    font-size: 0.95rem;
}

.redirect-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.redirect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.download-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border-color: #10b981 !important;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Result Area */
.result-area {
    margin-top: 1.5rem;
}

.status-summary {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    word-break: break-word;
}

.chain-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.chain-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
    flex-wrap: wrap;
}

.chain-step:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.step-num {
    min-width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-url {
    flex: 1;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--text);
}

.step-status {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.status-200 { 
    background: #d1fae5; 
    color: #065f46; 
}
.status-301,
.status-302,
.status-303,
.status-307,
.status-308 { 
    background: #fef3c7; 
    color: #92400e; 
}
.status-404 { 
    background: #fee2e2; 
    color: #991b1b; 
}
.status-Error,
.status-0 { 
    background: #fee2e2; 
    color: #991b1b; 
}

/* Loading Overlay */
.redirect-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.redirect-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Download Card Container */
.download-card-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
}

.download-card {
    width: 520px;
    max-width: 100%;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.18);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.dark-mode .download-card {
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.download-card-bg-decoration {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.download-card-corner-decoration {
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: conic-gradient(from 90deg at 50% 50%, var(--primary), transparent 120deg);
    opacity: 0.07;
    border-radius: 50%;
}

.download-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 1rem;
}

.download-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.download-logo-icon {
    font-size: 1.8rem;
}

.download-logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.download-date {
    color: var(--text-light);
    font-size: 0.95rem;
}

.download-card-body {
    position: relative;
    z-index: 1;
}

.download-url {
    background: var(--bg);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.download-result-box {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    padding: 1.6rem;
    border-radius: 16px;
    text-align: center;
    margin: 1.5rem 0;
}

.download-result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    display: block;
}

.download-result-value {
    font-size: 1.1rem;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.download-chain {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.download-chain .status {
    font-weight: bold;
    color: var(--primary);
}

.download-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.download-timestamp {
    font-size: 0.8rem;
    color: var(--text-light);
}

.download-brand {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.download-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn-primary:hover {
    background: var(--primary-light, #818cf8);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.download-btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Examples Section */
.redirect-examples {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.redirect-examples h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.example-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* SEO Section */
.redirect-seo {
    margin: 4rem 0;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.redirect-seo h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.redirect-seo h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: var(--text);
}

.redirect-seo p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.redirect-howto-list,
.redirect-features-list {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.redirect-howto-list li,
.redirect-features-list li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.redirect-howto-list li::marker,
.redirect-features-list li::marker {
    color: var(--primary);
}

.redirect-features-list {
    list-style: none;
    padding: 0;
}

.redirect-features-list li {
    padding-left: 1.5rem;
    position: relative;
}

.redirect-features-list li::before {
    content: '✓';
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* ====================== RESPONSIVE DESIGN ====================== */

/* Tablet Styles (768px to 1024px) */
@media screen and (max-width: 1024px) {
    .redirect-container {
        padding: 0 1.5rem;
        margin: 1.5rem auto;
    }

    .redirect-title {
        font-size: 2.5rem;
    }

    .redirect-icon {
        font-size: 2.3rem;
    }

    .redirect-card {
        padding: 1.8rem;
    }
}

/* Mobile Landscape & Tablet Portrait (481px to 768px) */
@media screen and (max-width: 768px) {
    .redirect-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .redirect-title {
        font-size: 2rem;
    }

    .redirect-icon {
        font-size: 1.8rem;
    }

    .redirect-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .redirect-card {
        padding: 1.2rem;
    }

    .redirect-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .redirect-input,
    .redirect-textarea {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .redirect-btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
    }

    .chain-step {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .step-num {
        align-self: flex-start;
    }

    .step-status {
        align-self: flex-start;
        white-space: normal;
    }

    .status-summary {
        font-size: 0.95rem;
    }

    .download-card {
        padding: 1.5rem;
    }

    .download-result-value {
        font-size: 0.9rem;
    }

    .download-chain {
        font-size: 0.8rem;
        max-height: 250px;
    }

    .example-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    .redirect-seo {
        padding: 1.5rem;
    }

    .redirect-seo h2 {
        font-size: 1.5rem;
    }

    .redirect-seo h3 {
        font-size: 1.1rem;
    }
}

/* Mobile Portrait (up to 480px) */
@media screen and (max-width: 480px) {
    .redirect-container {
        padding: 0 0.75rem;
        margin: 0.75rem auto;
    }

    .redirect-title {
        font-size: 1.5rem;
    }

    .redirect-icon {
        font-size: 1.3rem;
    }

    .redirect-subtitle {
        font-size: 0.85rem;
    }

    .redirect-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .redirect-tabs {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .redirect-tab {
        width: 100%;
        text-align: center;
    }

    .redirect-actions {
        flex-direction: column;
    }

    .redirect-btn {
        width: 100%;
        text-align: center;
    }

    .chain-step {
        padding: 0.8rem;
    }

    .step-url {
        font-size: 0.85rem;
    }

    .step-status {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    .status-summary {
        font-size: 0.85rem;
        padding: 0.8rem;
    }

    .download-card {
        padding: 1rem;
    }

    .download-card-header {
        flex-direction: column;
        text-align: center;
    }

    .download-logo-text {
        font-size: 1.2rem;
    }

    .download-result-box {
        padding: 1rem;
    }

    .download-result-value {
        font-size: 0.8rem;
    }

    .download-chain {
        font-size: 0.75rem;
        max-height: 200px;
    }

    .download-controls {
        flex-direction: column;
    }

    .download-btn-primary,
    .download-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .example-buttons {
        gap: 0.6rem;
    }

    .example-btn {
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
    }

    .redirect-seo h2 {
        font-size: 1.2rem;
    }

    .redirect-seo h3 {
        font-size: 1rem;
    }

    .redirect-seo p,
    .redirect-howto-list li,
    .redirect-features-list li {
        font-size: 0.85rem;
    }
}

/* Extra Small Devices (up to 360px) */
@media screen and (max-width: 360px) {
    .redirect-title {
        font-size: 1.3rem;
    }

    .redirect-icon {
        font-size: 1.1rem;
    }

    .step-url {
        font-size: 0.75rem;
    }

    .download-result-value {
        font-size: 0.7rem;
    }
}

/* Touch-friendly improvements for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .redirect-tab,
    .redirect-btn,
    .example-btn,
    .download-btn-primary,
    .download-btn-secondary {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .redirect-btn:active,
    .example-btn:active {
        transform: scale(0.98);
    }
}

/* Loading overlay responsiveness */
@media screen and (max-width: 768px) {
    .redirect-spinner {
        width: 40px;
        height: 40px;
    }

    .redirect-loading p {
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .redirect-tabs,
    .redirect-actions,
    .redirect-examples,
    .download-controls,
    .redirect-seo {
        display: none;
    }

    .redirect-container {
        padding: 0;
        margin: 0;
    }

    .redirect-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .chain-step {
        break-inside: avoid;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    .redirect-card {
        background: var(--surface);
    }
}

/* Scrollbar styling */
.redirect-textarea::-webkit-scrollbar,
.chain-list::-webkit-scrollbar,
.download-chain::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.redirect-textarea::-webkit-scrollbar-track,
.chain-list::-webkit-scrollbar-track,
.download-chain::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

.redirect-textarea::-webkit-scrollbar-thumb,
.chain-list::-webkit-scrollbar-thumb,
.download-chain::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}