
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #6200ee;
    --primary-variant-color: #3700b3;
    --secondary-color: #03dac6;
    --text-color: #e0e0e0;
    --text-secondary-color: #b0b0b0;
    --error-color: #cf6679;
    --success-color: #4caf50;
    --warning-color: #ffc107;
    --danger-color: #f44336;
    --border-color: #333;
    --font-family: 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

main {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.1rem;
    color: var(--text-secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

.analysis-container {
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tabs {
    display: flex;
    background-color: rgba(0,0,0,0.2);
}

.tab-btn {
    flex-grow: 1;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: transparent;
    color: var(--text-secondary-color);
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

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

.input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem;
}

#url-input, .file-drop-zone {
    flex-grow: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(98, 0, 238, 0.3);
}

.file-drop-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
}

.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(98, 0, 238, 0.1);
}

#file-name-display {
    color: var(--text-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1rem;
}

.file-browse-text {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

#analyze-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

#analyze-btn:hover {
    background-color: var(--primary-variant-color);
}

#analyze-btn:active {
    transform: scale(0.98);
}

#analyze-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    color: var(--text-secondary-color);
}

.hidden {
    display: none !important;
}

#results-container {
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 2rem;
}

#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary-color);
    min-height: 150px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--secondary-color);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

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

#error-message {
    background-color: rgba(207, 102, 121, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

/* Gauge Styles */
.gauge-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.gauge {
    width: 220px;
}

.gauge-bg, .gauge-arc {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.gauge-bg {
    stroke: var(--border-color);
}

.gauge-label {
    fill: var(--text-secondary-color);
    font-size: 10px;
    font-weight: 500;
}

.gauge-score-text {
    fill: var(--text-color);
    font-size: 20px;
    font-weight: 700;
    text-anchor: middle;
}

.gauge-needle-group {
    transform-origin: 50px 50px;
    transition: transform 0.6s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    transform: rotate(-90deg); /* Initial position at score 1 */
}

.gauge-needle {
    stroke: var(--secondary-color);
    stroke-width: 2;
    stroke-linecap: round;
}

.gauge-pivot {
    fill: var(--secondary-color);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.result-header h2 {
    font-size: 1.5rem;
    margin-right: auto; /* Push other items to the right */
}

#re-analyze-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--border-color);
    color: var(--text-color);
    border: 1px solid #4f4f4f;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#re-analyze-btn:hover {
    background-color: #444;
}

#re-analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#reset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #4a4a4a;
    color: var(--text-color);
    border: 1px solid #5f5f5f;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#reset-btn:hover {
    background-color: #585858;
}

#reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


#rating-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
}

#rating-badge.safe {
    background-color: var(--success-color);
    color: black;
}

#rating-badge.suspicious {
    background-color: var(--warning-color);
    color: black;
}

#rating-badge.dangerous {
    background-color: var(--danger-color);
    color: white;
}

.result-body h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-body ul {
    list-style-type: none;
    padding-left: 0;
}

#details-list li {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

#sources-container {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
}

#sources-container h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

#sources-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
#sources-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#sources-list a {
    color: var(--secondary-color);
    text-decoration: none;
}

#sources-list a:hover {
    text-decoration: underline;
}

.disclaimer {
    text-align: center;
    color: var(--text-secondary-color);
    font-size: 0.85rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.disclaimer p {
    max-width: 90%;
    margin: 0 auto;
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    header h1 {
        font-size: 2rem;
    }
    .input-area {
        flex-direction: column;
    }
    .result-header {
      flex-wrap: wrap;
    }
}