:root {
    /* Base Themes Shared Variables */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-terminal: 'VT323', monospace;
    --transition-speed: 0.3s;
    --pattern-opacity: 0.05;

    /* Theme: Professional Light (Default) */
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --subtext-color: #475569;
    --accent-color: #2563eb;
    --item-bg: #ffffff;
    --item-border: #e2e8f0;
    --hover-bg: #f1f5f9;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --switcher-bg: var(--item-bg);
    --switcher-text: var(--text-color);
    --switcher-label: var(--subtext-color);
}

/* Theme: Professional Dark */
[data-theme="professional-dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --subtext-color: #94a3b8;
    --accent-color: #38bdf8;
    --item-bg: #1e293b;
    --item-border: #334155;
    --hover-bg: #334155;
    --card-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
    --pattern-opacity: 0.03;
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* Theme: Retro 80s */
[data-theme="80s"] {
    --bg-color: #1a0b2e;
    --text-color: #ff00ff;
    --subtext-color: #00ffff;
    --accent-color: #ffff00;
    --item-bg: #2d1b4d;
    --item-border: #ff00ff;
    --hover-bg: #4a2b82;
    --card-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-45c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm26 18c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm16 18c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zM9 26c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm18-11c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm81 17c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm-28 41c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zM75 38c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1z' fill='%23ff00ff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Theme: Gaming */
[data-theme="gaming"] {
    --bg-color: #050505;
    --text-color: #ffffff;
    --subtext-color: #888;
    --accent-color: #ff3e3e;
    --item-bg: #111;
    --item-border: #333;
    --hover-bg: #1a1a1a;
    --card-shadow: 0 0 20px rgba(255, 62, 62, 0.2);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ff3e3e' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-2.21 0-4 1.79-4 4s1.79 4 4 4c2.21 0 4-1.79 4-4zm2 0c0 3.314-2.686 6-6 6s-6-2.686-6-6 2.686-6 6-6 6 2.686 6 6zm25.414 4.586c-1.353-1.353-3.151-2.1-5.068-2.1s-3.715.747-5.068 2.1c-1.353 1.353-2.1 3.151-2.1 5.068s.747 3.715 2.1 5.068c1.353 1.353 3.151 2.1 5.068 2.1s3.715-.747 5.068-2.1c1.353-1.353 2.1-3.151 2.1-5.068s-.747-3.715-2.1-5.068zM26.414 16c0-1.314 1.066-2.38 2.38-2.38 1.314 0 2.38 1.066 2.38 2.38 0 1.314-1.066 2.38-2.38 2.38-1.314 0-2.38-1.066-2.38-2.38zm15.352 4.793c-.814-.814-1.897-1.263-3.058-1.263-1.16 0-2.244.449-3.058 1.263-.814.814-1.263 1.897-1.263 3.058 0 1.161.449 2.244 1.263 3.058.814.814 1.897 1.263 3.058 1.263 1.161 0 2.244-.449 3.058-1.263.814-.814 1.263-1.897 1.263-3.058 0-1.161-.449-2.244-1.263-3.058zm-3.058 1.587c.287 0 .548.112.742.305.193.194.305.455.305.742s-.112.548-.305.742c-.194.193-.455.305-.742.305s-.548-.112-.742-.305c-.193-.194-.305-.455-.305-.742s.112-.548.305-.742c.194-.193.455-.305.742-.305z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Theme: Blueprint */
[data-theme="blueprint"] {
    --bg-color: #1e40af;
    --text-color: #ffffff;
    --subtext-color: #bfdbfe;
    --accent-color: #ffffff;
    --item-bg: rgba(255, 255, 255, 0.1);
    --item-border: rgba(255, 255, 255, 0.3);
    --hover-bg: rgba(255, 255, 255, 0.2);
    --card-shadow: none;
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='white' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M0 0h40v40H0V0zm1 1v38h38V1H1z'/%3E%3C/g%3E%3C/svg%3E");
    --switcher-bg: #1e40af;
    --switcher-label: #bfdbfe;
}

/* Theme: Matrix */
[data-theme="matrix"] {
    --bg-color: #000000;
    --text-color: #00ff41;
    --subtext-color: #008f11;
    --accent-color: #00ff41;
    --item-bg: #000000;
    --item-border: #003b00;
    --hover-bg: #001100;
    --card-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    --bg-pattern: none;
    --font-main: 'VT323', monospace;
}

/* Theme: 3.11 */
[data-theme="90s"] {
    --bg-color: #008080;
    /* Classic Teal */
    --text-color: #000000;
    --subtext-color: #444444;
    --accent-color: #000080;
    /* Navy */
    --item-bg: #c0c0c0;
    /* Silver/Gray */
    --item-border: #ffffff #808080 #808080 #ffffff;
    /* Bevelled look */
    --hover-bg: #d4d4d4;
    --card-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    --bg-pattern: none;
    --switcher-bg: #c0c0c0;
    --switcher-text: #000000;
    --switcher-label: #444444;
}

/* Theme: 70s Retro (Groovy tones) */
[data-theme="70s"] {
    --bg-color: #3d2b1f;
    /* Deep Brown */
    --text-color: #f6a90a;
    /* Harvest Gold */
    --subtext-color: #e35205;
    /* Burnt Orange */
    --accent-color: #8c9b20;
    /* Avocado Green */
    --item-bg: #5d4037;
    --item-border: #f6a90a;
    --hover-bg: #6d4c41;
    --card-shadow: 8px 8px 0px rgba(227, 82, 5, 0.3);
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='20' fill='%23e35205' fill-opacity='0.1' /%3E%3C/svg%3E");
    --switcher-bg: #e35205;
    --switcher-text: #ffffff;
    --switcher-label: #3d2b1f;
}

/* Layout Core */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: var(--bg-pattern);
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

/* Theme Control Panel */
.theme-switcher-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--switcher-bg, var(--item-bg));
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid var(--item-border);
    box-shadow: var(--card-shadow);
}

.theme-switcher-container label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--switcher-label, var(--subtext-color));
    text-transform: uppercase;
    letter-spacing: 1px;
}

#theme-select {
    background: transparent;
    border: none;
    color: var(--switcher-text, var(--text-color));
    font-family: var(--font-main);
    font-weight: 700;
    cursor: pointer;
    outline: none;
    font-size: 0.9rem;
}

#theme-select option {
    background-color: var(--bg-color);
    /* Use solid bg-color to prevent transparency issues */
    color: var(--text-color);
}

/* Content Layout */
.main-content {
    max-width: 1200px;
    width: 90%;
    margin: 6rem auto;
    text-align: left;
    padding-bottom: 5rem;
}

.dictionary-definition {
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out both;
}

.definition-word {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
}

.definition-phonetic {
    font-family: var(--font-terminal);
    color: var(--accent-color);
    font-size: 1.2rem;
    margin: 0.5rem 0;
    opacity: 0.8;
}

.definition-type {
    font-style: italic;
    color: var(--subtext-color);
    font-size: 1.0rem;
    margin-bottom: 1rem;
}

.definition-text {
    font-size: 1.5rem;
    color: var(--text-color);
    line-height: 1.4;
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.group-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    margin: 0 0 1.5rem 0;
    font-weight: 800;
    opacity: 0.7;
    border-bottom: 1px solid var(--item-border);
    padding-bottom: 0.5rem;
}

/* Link List / Cards */
.link-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
    /* Horizontal gap between columns */
    width: 100%;
}

.link-group {
    display: block;
    width: 100%;
    margin-bottom: 4rem;
    /* Spacing between groups in single column view */
}

.link-group:last-child {
    margin-bottom: 0;
}

.link-group .group-header:first-child {
    margin-top: 0;
}

/* Simplified headers - logic moved to link-group */

.link-list-inner {
    display: flex;
    flex-direction: column;
}

.link-list-inner .list-item {
    margin-bottom: 2rem;
}

.link-list-inner .list-item:last-child {
    margin-bottom: 0;
}

.list-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    padding: 2rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.list-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-pattern);
    opacity: 0.3;
    pointer-events: none;
}

.list-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
    background: var(--hover-bg);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.list-item .icon {
    font-size: 2rem;
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5px;
}

.list-item .text-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item .text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.list-item .subtext {
    font-size: 1rem;
    color: var(--subtext-color);
    line-height: 1.5;
    margin: 0;
}

.inline-link {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.inline-link:hover {
    color: var(--text-color);
}

/* Socials Bar */
.socials-footer {
    width: 100%;
    max-width: 800px;
    border-top: 1px solid var(--item-border);
    margin-top: 4rem;
    padding: 3rem 0;
    display: flex;
    justify-content: flex-start;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.2s;
    opacity: 0.7;
}

.social-link:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-link i {
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-item {
    animation: fadeIn 0.6s ease-out both;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    /* Removed previous link-list rule */
}

@media (max-width: 1000px) {
    .link-list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .main-content {
        margin: 4rem auto;
    }
}

@media (max-width: 600px) {
    .main-content {
        width: 95%;
    }

    .definition-word {
        font-size: 2.5rem;
    }

    .definition-text {
        font-size: 1.2rem;
    }

    .list-item {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1rem;
    }

    .list-item .icon {
        justify-content: flex-start;
    }

    .theme-switcher-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
    }
}