/* assets/style.css */
:root {
    /* Default variables - overridden by themes */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --bg-gradient-1: rgba(99, 102, 241, 0.1);
    --bg-gradient-2: rgba(168, 85, 247, 0.1);
}

/* THEMES */
.theme-classic {
    /* Already default, but explicit */
    --primary: #4f46e5;
    --bg-color: #f8fafc;
}

.theme-ocean {
    --primary: #0ea5e9;
    --bg-color: #f0f9ff;
    --bg-gradient-1: rgba(14, 165, 233, 0.1);
    --bg-gradient-2: rgba(56, 189, 248, 0.1);
}

.theme-dark {
    --primary: #6366f1;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --bg-gradient-1: rgba(99, 102, 241, 0.15);
    --bg-gradient-2: rgba(168, 85, 247, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    flex: 1;
    /* Pushes footer down if content is short */
    display: flex;
    flex-direction: column;
}

/* HEADER REFACTOR */
/* Main Header Reform */
.main-header {
    margin-bottom: 2rem;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.link-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  width: 100%;
}

.link-meta-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  max-width: 60%;
}

.link-favicon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.link-site-name {
  font-size: 0.85rem;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-url {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex-shrink: 1;
}

.brand-name {
    font-weight: 800;
    font-size: 1.55rem;
    color: var(--text-main);
    letter-spacing: 0.03em;
}

.header-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive Header */
@media (max-width: 600px) {
    .compact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-tagline {
        font-size: 0.85rem;
    }
}

/* Compact Header (Shared) */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.brand-subtle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.brand-subtle:hover {
    opacity: 1;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.05);
}

/* List Title (Personal Page Feel) */
.list-hero {
    margin-bottom: 1rem;
    text-align: left;
}

.list-hero h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.list-hero p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Default Header (Input Page - Keep centralized but subtle) */
.input-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.input-header .logo-symbol {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.input-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.input-header .tagline {
    font-size: 1rem;
    color: var(--text-muted);
}


/* Footer */
.site-footer {
    margin-top: auto;
    /* Pushed to bottom */
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Footer Typography */
.main-footer p,
.main-footer a {
    font-size: 0.95rem;
    /* Slightly larger footer text */
}

/* Lighten Header on Profile/List View */
.view-page-header {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

/* Condense the branding header specifically on the view page */
.view-page-header .compact-header {
    padding: 0.5rem 0;
    margin-bottom: 1.25rem;
}

.view-page-header:hover {
    opacity: 1;
    /* Focus back on hover */
}

.view-page-header .brand-name {
    color: var(--text-muted);
}

.footer-attribution {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Content Pages */
.content-page {
    line-height: 1.8;
}

.content-page h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.content-page p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.content-page a {
    color: var(--primary);
    text-decoration: none;
}


/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px var(--shadow-color);
    margin-bottom: 1.5rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group input,
textarea {
    width: 100%;
    background: #f8fafc;
    /* Slightly darker than white for contrast */
    border: 2px solid #e2e8f0;
    /* Thicker border */
    padding: 1rem;
    padding-right: 3rem;
    /* Space for X button */
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    /* Bolder text */
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    /* Inner shadow for depth */
}

.remove-btn-inline {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.1);
    /* Red tint */
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    /* Squarish X button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
    padding: 0;
}

.remove-btn-inline:hover {
    background: #ef4444;
    color: white;
}

.input-group input:focus,
textarea:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Centered Actions */
.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.form-actions .btn {
    width: auto;
    min-width: 200px;
    padding-left: 2rem;
    padding-right: 2rem;
}

.input-group input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group input::placeholder,
textarea::placeholder {
    color: #64748b;
    /* Much darker placeholder (Slate 500) */
    font-weight: 500;
    opacity: 1;
    /* Firefox fix */
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1.5rem 0;
}

/* Toggles */
.toggle-container {
    background: #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    display: flex;
    margin-bottom: 1.5rem;
    border: none;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Streamlined Mode Switch */
.mode-switch-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.mode-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    /* Pill shape */
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.01em;
}

.mode-switch-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mode-switch-btn:active {
    transform: translateY(0);
}

/* Add a subtle indicator distinct from the text */
/* Icon removed per user request */

.compact-toggle-option .compact-label {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 20px;
    transition: all 0.2s;
    border: 1px solid transparent;
    /* Prevents layout shift */
}

.compact-toggle-option:hover .compact-label {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.compact-toggle-option input:checked+.compact-label {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
    border-color: rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-secondary {
    background: white;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text-main);
}

/* Copy Toast */
.copy-feedback {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.copy-feedback.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Links */
.link-item {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    display: block;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.link-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.link-content {
    padding: 1rem;
}

.link-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.link-url {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Embeds */
.link-embed-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.netflix-card {
    background: #000;
    color: #e50914;
    padding: 2rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.netflix-card a {
    color: #e50914;
    text-decoration: none;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    background: black;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Title Position Toggle */
.position-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.radio-label input {
    accent-color: var(--primary);
}

/* Hero Input Highlight */
input.input-hero {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    /* Very subtle primary tint */
    font-size: 1.1rem;
    font-weight: 700;
}

input.input-hero:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

@media (max-width: 600px) {
    input.input-hero {
        font-size: 0.95rem;
        /* Smaller text on mobile */
    }

    input.input-hero::placeholder {
        font-size: 0.85rem;
        /* Even smaller placeholder to fit text */
        letter-spacing: -0.01em;
        /* Tighten slightly */
    }
}

.list-hero-bottom {
    margin-top: 2rem;
    margin-bottom: 0;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.hidden {
    display: none !important;
}

/* Hint Text */
.hint {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(241, 245, 249, 0.5);
    /* Very subtle bg */
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.hint::before {
    content: '⚡';
    /* Lightning to match "instantly" */
    font-size: 1rem;
    opacity: 0.8;
}

/* Input Labels */
.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

/* Actions Card */
.actions-card {
    text-align: center;
}

.actions-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.full-width {
    width: 100%;
    margin-bottom: 1rem;
    display: block;
    text-decoration: none;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Social Share Buttons */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.btn-share {
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-share:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-fb {
    background-color: #1877F2;
}

.share-li {
    background-color: #0A66C2;
}

.share-x {
    background-color: #000000;
}

@media (max-width: 600px) {
    .share-buttons {
        gap: 0.5rem;
    }

    .btn-share {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
}