* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.sidebar {
    background: linear-gradient(to bottom, #2c3e50, #1a252f);
    padding: 2rem;
    width: 280px;
    flex-shrink: 0;
    color: #fff;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 2rem;
    background: #fff;
}

.main-content {
    flex: 1;
    min-width: 0; /* Important for proper text wrapping */
}

.right-panel {
    width: 280px;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.search-container {
    margin-bottom: 2rem;
    width: 100%;
}

.search-box {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s;
}

.search-box:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.sideBarTitle {
    font-weight: 600;
    color: #fff;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a5568;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.sidebar ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.sidebar li {
    margin: 0.75rem 0;
}

.sidebar a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.sidebar a:hover {
    color: #fff;
    text-decoration: none;
}

/* Fixed ad container */
.ads {
    margin: 2rem 0;
    padding: 0;
    border-radius: 8px;
    transition: transform 0.2s;
    text-align: center;
}

.ads:hover {
    transform: translateY(-3px);
}

.ads a {
    display: block;
    background: rgba(255, 255, 255, 0.55);
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ads img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    background: #2d3748;
    color: #e2e8f0;
}

.footer a {
    color: #90cdf4;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.nearest-words {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #4a5568;
}

.nearest-words a {
    color: #4299e1;
    text-decoration: none;
}

.nearest-words a:hover {
    text-decoration: underline;
}

.definition-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Reverting to original list and paragraph styles */
ol li {
    line-height: 1.1;
}

ol {
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/* Fix for examples and definitions */
.ex, .def {
    display: inline;
    white-space: normal;
}

.pron {
    font-family: Times, serif;
    font-size: 11pt;
    color: black;
}

.tit {
    font-size: 22pt;
    font-weight: bold;
    font-style: italic;
    color: maroon;
}

.def {
    font-size: 12pt;
    color: black;
    font-weight: 500;
    text-decoration: none;
}

A.l:hover {
    color: navy;
    text-decoration: underline;
}

.use {
    font-size: 11pt;
    color: blue;
}

.ex {
    font-size: 11pt;
    font-style: italic;
    color: green;
    text-decoration: none;
}

A.def:hover, A.ex:hover {
    color: navy;
    text-decoration: underline;
}

.key {
    font-size: 13pt;
    font-weight: bold;
    color: maroon;
}

.head {
    font-size: 13pt;
    font-weight: bold;
    color: black;
}

.seealso {
    font-size: 10pt;
    font-weight: bold;
    color: black;
}

.near {
    font-size: 10pt;
    color: black;
}

.syn {
    font-size: 10pt;
    color: navy;
    font-weight: 500;
}

.nr {
    font-size: 10pt;
}

.enclink {
    font-size: 10pt;
    color: blue;
    font-weight: bold;
}

.getprogs a {
    color: navy;
}

.getprogs {
    margin-bottom: 0.5ex;
    text-align: center;
}

h2 {
    color: navy;
}

/* Class for selected word in nearest-words panel */
.selwd {
    font-weight: bold;
    color: #2d3748;
}

@media (max-width: 1024px) {
    .container {
        margin: 0;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
    }

    .content-wrapper {
        order: 1;
        padding: 1rem;
    }

    .search-box {
        max-width: 100%;
    }
}
