* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --gray-light: #ecf0f1;
    --gray-dark: #34495e;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--gray-dark);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    flex: 1;
    padding: 40px 30px;
}

.input-section {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#urlInput {
    flex: 1;
    padding: 12px 16px;
    font-size: 1em;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#checkButton {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

#checkButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#checkButton:active {
    transform: translateY(0);
}

#checkButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.options input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.options input[type="number"] {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 0.9em;
}

.options input[type="number"]:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
}

.results-section {
    animation: slideIn 0.3s ease;
}

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

.progress-container {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--gray-dark);
}

.progress-bar {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.results-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: var(--gray-dark);
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    margin-left: 6px;
}

.tab-content {
    min-height: 300px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    padding: 16px;
    border-left: 4px solid;
    border-radius: 4px;
    background: var(--gray-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.link-item.broken {
    border-left-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
}

.link-item.working {
    border-left-color: var(--success-color);
    background: rgba(39, 174, 96, 0.05);
}

.link-url {
    font-weight: 600;
    color: var(--primary-color);
    word-break: break-all;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.link-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85em;
    color: #666;
}

.referrer-info {
    flex: 1;
    min-width: 200px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    font-size: 0.9em;
}

.referrer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
    transition: all 0.2s ease;
}

.referrer-link:hover {
    text-decoration: underline;
    color: #764ba2;
}

.status-code {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8em;
}

.status-code.error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

.status-code.success {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

.status-code.warning {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9em;
    margin-top: 6px;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    padding: 20px;
    border-radius: 8px;
    background: var(--gray-light);
    text-align: center;
}

.summary-card h3 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 8px;
}

.summary-card p {
    color: #666;
    font-size: 0.95em;
}

.summary-card.broken {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
}

.summary-card.success {
    background: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--success-color);
}

.summary-card.total {
    background: rgba(74, 144, 226, 0.1);
    border-left: 4px solid var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.secondary-button {
    padding: 12px 24px;
    background: var(--gray-light);
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-dark);
}

.secondary-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--white);
}

.error-section {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.error-box {
    padding: 16px;
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
    border-radius: 4px;
    color: var(--danger-color);
    font-weight: 500;
}

footer {
    background: var(--gray-light);
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    #checkButton {
        width: 100%;
    }

    .results-tabs {
        flex-direction: column;
    }

    .tab-button {
        border-bottom: none;
        border-left: 4px solid transparent;
        text-align: left;
    }

    .tab-button.active {
        border-bottom: none;
        border-left-color: var(--primary-color);
    }

    .summary-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 1em;
    }

    .link-details {
        flex-direction: column;
        align-items: flex-start;
    }
}
