/* IsItRug.com Stylesheet v3 (UI/UX Enhanced) */

/* --- Base & Variables --- */
:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #00ff9d;
    --primary-hover: #00e68a;
    --input-bg: #2a2a2a;
    --input-border: #444;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --red: #ff4d4d;
    --red-bg: rgba(255, 77, 77, 0.1);
    --yellow: #ffc107;
    --yellow-bg: rgba(255, 193, 7, 0.1);
    --green: #28a745;
    --green-bg: rgba(40, 167, 69, 0.1);
    --blue: #00aaff;
    --blue-bg: rgba(0, 170, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; /* Prevent scrollbars from animation */ }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    overflow-y: auto; /* Allow vertical scroll for content */
}

/* --- Animated Background --- */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(125deg, #0d1a26, #121212, #260d1a);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Main Container & Typography --- */
.container { width: 100%; max-width: 700px; display: flex; flex-direction: column; min-height: 80vh; justify-content: center; z-index: 1; }
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.2; text-shadow: 0 0 10px rgba(0, 255, 157, 0.3); }
h2 { font-size: 1.2rem; font-weight: 400; color: #a0a0a0; margin-bottom: 2.5rem; }

/* --- Form Elements --- */
.input-group { display: flex; flex-direction: column; gap: 1rem; }
.form-controls { display: flex; gap: 0.5rem; }
#contract-address { flex-grow: 1; min-width: 0; }
#chain-selector { flex-shrink: 0; width: 120px; }
#contract-address, #chain-selector { padding: 1.2rem; font-size: 1rem; background-color: rgba(42,42,42,0.8); border: 2px solid #444; border-radius: 8px; color: var(--text-color); text-align: center; transition: all 0.3s ease; appearance: none; -webkit-appearance: none; }
#chain-selectorcsvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e0e0e0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1em; padding-right: 2.5rem; }
#contract-address:focus, #chain-selector:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 15px rgba(0, 255, 157, 0.3); }
#check-button { padding: 1.2rem; font-size: 1.2rem; font-weight: 700; background: linear-gradient(45deg, var(--primary-color), #00d1ff); color: var(--bg-color); border: none; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; transform: scale(1); display: flex; align-items: center; justify-content: center; min-height: 60px; }
#check-button:hover, #check-button:focus { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 255, 157, 0.5); }
#check-button:disabled { cursor: not-allowed; background: #555; color: #999; transform: scale(1); box-shadow: none; }

/* --- Recent Searches --- */
#recent-searches-container { margin-top: 2rem; animation: fadeIn 0.5s ease-in-out; }
#recent-searches-container h4 { color: #aaa; font-weight: 500; margin-bottom: 0.8rem; }
#recent-searches-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.recent-item {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.recent-item:hover { background-color: #3a3a3a; border-color: var(--primary-color); color: var(--primary-color); }
.recent-item .chain-badge { font-size: 0.7em; background-color: #444; padding: 0.1em 0.4em; border-radius: 4px; margin-left: 0.5em; vertical-align: middle; }

/* --- Results Section --- */
.spinner { border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: var(--primary-color); border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#results-container { animation: fadeIn 0.5s ease-in-out; margin-top: 2rem; }
.verdict-card { padding: 2rem; border-radius: 12px; margin-bottom: 1.5rem; border: 2px solid; background-color: rgba(30, 30, 30, 0.7); backdrop-filter: blur(5px); }
.verdict-card.red { border-color: var(--red); }
.verdict-card.yellow { border-color: var(--yellow); }
.verdict-card.green { border-color: var(--green); }
.verdict-icon { font-size: 4rem; line-height: 1; }
.verdict-title { font-size: 2rem; font-weight: 700; margin-top: 0.5rem; }
.verdict-card.red .verdict-title { color: var(--red); }
.verdict-card.yellow .verdict-title { color: var(--yellow); }
.verdict-card.green .verdict-title { color: var(--green); }
.verdict-subtitle { font-size: 1.1rem; margin-top: 0.5rem; color: #ccc; max-width: 500px; margin-left: auto; margin-right: auto;}
.result-section { margin-bottom: 1.5rem; }
.result-section h4 { text-align: left; font-size: 1.2rem; margin-bottom: 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--card-border); }
.result-section.red h4 { color: var(--red); }
.result-section.yellow h4 { color: var(--yellow); }
.result-section.green h4 { color: var(--green); }
.result-section.info h4 { color: var(--blue); }
.risk-list { list-style: none; text-align: left; }
.risk-item { display: flex; align-items: flex-start; font-size: 1rem; padding: 0.8rem; background-color: var(--card-bg); border-radius: 6px; margin-bottom: 0.5rem; border-left: 4px solid var(--card-border); }
.risk-item .icon { margin-right: 0.8rem; font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.risk-item .text { text-align: left; word-break: break-word; }
.risk-item .text strong { color: var(--text-color); }
.risk-item .text span { color: #aaa; font-size: 0.9em; display: block; margin-top: 0.2rem; }
.share-button { width: 100%; padding: 1rem; font-size: 1.2rem; font-weight: 700; margin-top: 1rem; border-radius: 8px; cursor: pointer; border: 2px solid var(--primary-color); background-color: transparent; color: var(--primary-color); transition: all 0.3s ease; }
.share-button:hover { background-color: var(--primary-color); color: var(--bg-color); box-shadow: 0 0 15px rgba(0, 255, 157, 0.4); }

/* --- Footer --- */
footer { position: fixed; bottom: 0; left: 0; width: 100%; padding: 1rem; display: flex; justify-content: space-between; align-items: center; background-color: rgba(18, 18, 18, 0.8); backdrop-filter: blur(5px); font-size: 0.8rem; z-index: 10; }
.language-switcher select { background-color: var(--input-bg); color: var(--text-color); border: 1px solid var(--input-border); border-radius: 4px; padding: 0.3rem; cursor: pointer; }
.external-links a { color: #aaa; text-decoration: none; margin-left: 1rem; transition: color 0.3s ease; }
.external-links a:hover { color: var(--primary-color); }

/* --- Utility & Responsive --- */
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    body { padding: 0.5rem; align-items: flex-start; padding-top: 5vh; }
    .container { min-height: auto; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1rem; margin-bottom: 2rem; }
    .form-controls { flex-direction: column; }
    #chain-selector { width: 100%; }
    #contract-address, #check-button, #chain-selector { padding: 1rem; min-height: 50px; }
    footer { flex-direction: column; gap: 0.5rem; position: relative; margin-top: 3rem; background: transparent; backdrop-filter: none; }
}
