:root {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --gradient-start: #22c55e;
    --gradient-end: #14b8a6;
    --gradient-animated: linear-gradient(90deg, var(--gradient-start), var(--gradient-end), var(--gradient-start));
    --border-color: #333;
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
}

header {
    text-align: center;
    padding: 2rem 1rem;
}

@keyframes slideGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.main-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-animated);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: slideGradient 8s linear infinite;
}

/* --- Controls Bar --- */
.controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.search-container {
    position: relative;
    flex-grow: 1;
}

.search-bar {
    width: 100%;
    height: 48px;
    padding-left: 1rem;
    padding-right: 3.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 48px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    height: 48px;
    width: 48px;
    padding: 0;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
}
.icon-button:hover {
    transform: scale(1.1);
}
#settings-btn svg {
    stroke: url(#icon-gradient);
}


/* --- Watchlist Area & Cards --- */
.watchlist-area {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.entry-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}
.entry-card.dragging { opacity: 0.5; }
.entry-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}
.card-main-content {
    flex-grow: 1;
    min-width: 0;
}
.card-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--gradient-start);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
}
.card-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-left: auto;
}
.card-duration, .card-type {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* --- Modals & Forms --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; animation: fadeIn 0.3s ease;
}
.modal-content, .search-panel-content {
    background-color: var(--bg-card); padding: 2rem; border-radius: 12px;
    width: 90%; max-width: 500px; animation: slideIn 0.3s ease;
}
.modal-title {
    text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; font-weight: 500;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.entry-form input, .entry-form .form-row {
    margin-bottom: 0;
}

input[type="text"], input[type="number"], input[type="email"], input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0.75rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
    outline: none; border-color: var(--gradient-start);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
input[type=number] { 
    appearance: textfield;
    -moz-appearance: textfield; 
}
.form-row {
    display: flex;
    gap: 1rem;
}
.form-input-half {
    width: 50%;
}

.custom-dropdown {
    position: relative;
    width: 50%;
    height: 48px;
}
.dropdown-selected {
    background-color: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 0 0.75rem; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; height: 100%;
}
.custom-dropdown.open .dropdown-selected {
    border-color: var(--gradient-start);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}
.dropdown-arrow { transition: transform 0.3s ease; }
.custom-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.dropdown-options {
    position: absolute; top: calc(100% + 5px); left: 0; width: 100%;
    background-color: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 8px; list-style: none; padding: 0; margin: 0; z-index: 10;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease; opacity: 0;
}
.custom-dropdown.open .dropdown-options { max-height: 200px; opacity: 1; }
.dropdown-options li { padding: 0.75rem; cursor: pointer; transition: background-color 0.2s; }
.dropdown-options li:hover { background-color: var(--bg-input); }

/* --- Buttons --- */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}
.modal-buttons-center {
    justify-content: center;
}
.btn-primary, .btn-secondary, .btn-icon, .btn-danger {
    padding: 0.75rem 1.5rem; border: none; border-radius: 8px;
    cursor: pointer; font-size: 1rem; font-weight: 500;
    transition: all 0.3s ease; color: var(--text-primary);
}
.btn-primary { background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end)); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3); }
.btn-secondary { background-color: #333; }
.btn-secondary:hover { background-color: #444; }
.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #b91c1c; }

/* --- Settings & Auth --- */
#login-view, #signup-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-btn {
    width: 100%;
}
.auth-switcher {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}
.auth-switcher a {
    color: var(--gradient-start);
    text-decoration: none;
    font-weight: 500;
}
.auth-error-message {
    color: var(--danger-color);
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.import-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
#user-view > .btn-danger {
    width: 100%;
}

/* --- Advanced Search --- */
.search-filters { 
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.5rem 0; 
}
.filter-group { 
    margin-bottom: 0; 
}
.filter-group span { 
    display: block; 
    margin-bottom: 0.5rem; 
    color: var(--text-primary);
    font-weight: 500;
}
.filter-btn {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}
.filter-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 600px) {
    .main-title { font-size: 2.5rem; }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .modal-content, .search-panel-content { width: 95%; padding: 1.5rem; }
    .modal-buttons { flex-direction: column; gap: 0.5rem; }
    .btn-primary, .btn-secondary, .btn-danger { width: 100%; }
    .form-row { flex-direction: column; gap: 1rem; }
    .form-input-half, .custom-dropdown { width: 100%; }
}