/* Reusable Components */

/* Score Card */
.score-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.score-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.score-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.score-card-url {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 1.125rem;
    word-break: break-all;
}

.score-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.score-badge.excellent {
    background: var(--gradient-success);
    color: var(--white);
}

.score-badge.good {
    background: var(--gradient-primary);
    color: var(--white);
}

.score-badge.fair {
    background: var(--gradient-warning);
    color: var(--white);
}

.score-badge.poor {
    background: var(--gradient-danger);
    color: var(--white);
}

.score-card-body {
    margin-bottom: 1rem;
}

.score-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.score-bar-label {
    min-width: 100px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.score-bar-progress {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.score-bar-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--gray-900);
}

.score-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.score-card-date {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.score-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-sm.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.circular-progress svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.circular-progress-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 10;
}

.circular-progress-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.3s ease;
}

.circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.circular-progress-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
    transition: color 0.3s ease;
}

.circular-progress-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Responsive Circular Progress */
@media (max-width: 768px) {
    .circular-progress {
        width: 150px;
        height: 150px;
    }

    .circular-progress-value {
        font-size: 2.5rem;
    }

    .circular-progress-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .circular-progress {
        width: 120px;
        height: 120px;
    }

    .circular-progress-value {
        font-size: 2rem;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 2rem;
}

.tab {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

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

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

.tab-content {
    display: none;
}

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

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge.primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 200px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.pagination-btn.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
}

.pagination-info {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Settings Page */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
}

.settings-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.settings-section-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.settings-section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.setting-item:hover {
    background: var(--gray-50);
}

.setting-info {
    flex: 1;
}

.setting-info label {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.setting-info p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

.setting-control {
    flex-shrink: 0;
    min-width: 200px;
}

.setting-control .input,
.setting-control .select {
    width: 100%;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: var(--gradient-primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* About Section */
.about-info {
    text-align: center;
    padding: 2rem;
}

.about-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-logo img {
    width: 50px;
    height: 50px;
}

.about-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.about-info .version {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.about-info p {
    color: var(--gray-700);
    margin-bottom: 1.5rem;
}

.about-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.settings-actions .btn-primary {
    min-width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .setting-control {
        width: 100%;
        min-width: auto;
    }

    .settings-section {
        padding: 1.5rem;
    }

    .settings-section-header h2 {
        font-size: 1.25rem;
    }
}
