/* Plugin page layout */
.plugins-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    box-sizing: border-box;
}

/* Override screen.css .content styles for plugins page */
.content.plugins-page {
    max-width: 1141px !important;
    width: 95% !important;
    overflow: hidden !important;
}

/* Tab navigation */
.plugins-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 0;
}

.plugins-nav .nav-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.plugins-nav .nav-tab:hover {
    color: #333;
}

.plugins-nav .nav-tab.active {
    color: #feb672;
    border-bottom-color: #feb672;
}

/* Tab content */
.tab-content {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
}

/* Search and pagination row */
.search-pagination-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.search-pagination-row.bottom-only {
    margin-top: 20px;
    margin-bottom: 0;
    justify-content: center;
}

.search-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box-inline {
    position: relative;
    flex-shrink: 0;
}

.search-box-inline input {
    width: 200px;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    box-sizing: border-box;
}

.search-box-inline input:focus {
    outline: none;
    border-color: #feb672;
}

.grails-version-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.grails-version-filter label {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
}

.grails-version-filter select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    background: #fff;
    cursor: pointer;
    min-width: 120px;
}

.grails-version-filter select:focus {
    outline: none;
    border-color: #feb672;
}

.search-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
}

.search-clear-btn:hover {
    color: #666;
}

.search-box-inline.has-value .search-clear-btn {
    display: block;
}

.search-pagination-row .pagination-container {
    flex-shrink: 0;
}

.section-title {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #feb672;
}

.links-section {
    max-width: 600px;
}

.links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-list li {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
}

.links-list li a {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.links-list li a:hover {
    color: #feb672;
}

.links-list li p {
    margin: 8px 0 0;
    color: #666;
    font-size: 0.9em;
}

/* Plugin list container - responsive grid */
.plugin-list {
    padding-left: 0;
    margin: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 1 column for small screens */
@media screen and (max-width: 600px) {
    .plugin-list {
        grid-template-columns: 1fr;
    }
}

/* Plugin card */
li.plugin {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

/* Deprecated plugin card */
li.plugin.deprecated {
    opacity: 0.7;
    background: #fafafa;
}

li.plugin.deprecated:hover {
    opacity: 0.9;
}

.deprecated-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 0.65em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    flex-shrink: 0;
}

/* Plugin header row */
li.plugin .plugin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

/* Plugin name */
li.plugin h3.name {
    margin: 0;
    font-size: 1.2em;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

li.plugin h3.name a {
    color: #333;
    text-decoration: none;
}

li.plugin h3.name a:hover {
    color: #feb672;
}

/* Description */
li.plugin p.desc {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Version dropdown */
.version-dropdown {
    position: relative;
    flex-shrink: 0;
}

.version-current {
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75em;
    border: 1px solid #ddd;
    cursor: pointer;
    user-select: none;
}

.version-current:hover {
    border-color: #ccc;
}

.version-current .version-row {
    display: flex;
    align-items: stretch;
    white-space: nowrap;
}

.version-current .version {
    background: #f0f0f0;
    color: #555;
    padding: 2px 8px;
    font-weight: 600;
    flex-grow: 1;
}

/* When version is the only element (no grails-compat), it should fill the row */
.version-current .version:last-child {
    border-radius: 0;
}

.version-current .grails-compat {
    background: #f8f8f8;
    color: #777;
    padding: 2px 8px;
    border-left: 1px solid #ddd;
}

.version-current .dropdown-arrow {
    background: #f0f0f0;
    color: #555;
    padding: 2px 8px;
    border-left: 1px solid #ddd;
    font-size: 1em;
    line-height: 1;
    display: flex;
    align-items: center;
}

.version-current .version-date-row {
    background: #fafafa;
    color: #888;
    padding: 2px 8px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.9em;
}

.version-dropdown.open .version-current .dropdown-arrow {
    color: #333;
}

.version-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 280px;
    max-height: 250px;
    overflow-y: auto;
}

.version-dropdown.open .version-list {
    display: block;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    font-size: 0.85em;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.version-item:last-child {
    border-bottom: none;
}

.version-item:hover {
    background: #f8f8f8;
}

.version-item .ver {
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.version-item .date {
    color: #999;
    font-size: 0.9em;
    flex-shrink: 0;
}

.version-item .compat {
    color: #777;
    font-size: 0.9em;
    text-align: right;
    flex-shrink: 0;
}

/* Legacy pill style (fallback) */
.plugin-meta {
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75em;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.plugin-meta .version-row {
    display: flex;
    align-items: stretch;
    white-space: nowrap;
}

.plugin-meta .version {
    background: #f0f0f0;
    color: #555;
    padding: 2px 8px;
    font-weight: 600;
    flex-grow: 1;
}

.plugin-meta .grails-compat {
    background: #f8f8f8;
    color: #777;
    padding: 2px 8px;
    border-left: 1px solid #ddd;
}

.plugin-meta .version-date-row {
    background: #fafafa;
    color: #888;
    padding: 2px 8px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.9em;
}

/* Maven coordinates wrapper */
.coords-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
}

.coords-wrapper a.maven-link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.coords-wrapper a.maven-link:hover code.coords {
    background: #eaeaea;
}

/* Override screen.css code { margin: 0 !important; padding: 0 !important; } */
li.plugin .coords-wrapper code.coords {
    display: block;
    width: 100%;
    background: #f5f5f5;
    padding: 12px 14px !important;
    margin: 0 !important;
    font-size: 0.8em;
    color: #555;
    border: none;
    border-radius: 0;
    transition: background 0.2s;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.coords-wrapper .copy-btn {
    flex-shrink: 0;
    width: 44px;
    padding: 0 14px;
    background: #e8e8e8;
    border: none;
    border-left: 1px solid #ddd;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coords-wrapper .copy-btn:hover {
    background: #ddd;
}

.coords-wrapper .copy-btn.copied {
    background: #4caf50;
    color: white;
}

/* Plugin card footer */
.plugin-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.plugin-card-footer .footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.plugin-card-footer .owner-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #f0f4f8;
    color: #5a7a9a;
    border-radius: 12px;
    font-size: 0.75em;
    text-decoration: none;
    transition: background 0.2s;
}

.plugin-card-footer .owner-pill .owner-icon {
    font-size: 0.8em;
    color: #5a7a9a;
}

.plugin-card-footer .owner-pill:hover {
    background: #e0e8f0;
    color: #4a6a8a;
}

.plugin-card-footer .owner-pill:hover .owner-icon {
    color: #4a6a8a;
}

.plugin-card-footer .docs-link {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #555;
    font-size: 0.75em;
    text-decoration: none;
    transition: background 0.2s;
}

.plugin-card-footer .docs-link:hover {
    background: #e0e0e0;
}

.plugin-card-footer .license {
    color: #888;
    font-size: 0.7em;
    padding: 2px 6px;
    background: #f8f8f8;
    border-radius: 3px;
}

/* GitHub stars - toned down, inline with tags */
.github-stars {
    display: inline-flex;
    align-items: center;
    color: #888;
    font-size: 0.75em;
}

/* Tags row with GitHub stars */
.plugin-tags-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Labels/tags */
li.plugin ul.labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

li.plugin ul.labels li.label {
    padding: 0;
    box-shadow: none;
    background: none;
}

li.plugin ul.labels li.label a {
    display: inline-block;
    padding: 3px 8px;
    background: #f0f4f8;
    color: #5a7a9a;
    border-radius: 3px;
    font-size: 0.75em;
    text-decoration: none;
    transition: background 0.2s;
}

li.plugin ul.labels li.label a:hover {
    background: #e0e8f0;
}


/* Two column layout adjustments */
div.two-columns div.column {
    width: 44.326906%;
    padding: 15px;
}

article.quote, .guide-group {
    border-top: 0;
    padding-top: 0px;
}

.column-header {
    margin-top: 50px;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #333;
    border-bottom: 2px solid #feb672;
    padding-bottom: 8px;
}

/* Responsive adjustments - matches main site breakpoint */
@media screen and (max-width: 960px) {
    li.plugin {
        padding: 16px;
    }

    .plugins-nav {
        gap: 2px;
    }

    .plugins-nav .nav-tab {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .search-pagination-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .search-filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
    }

    .search-box-inline {
        width: 100%;
    }

    .search-box-inline input {
        width: 100%;
    }

    .grails-version-filter {
        width: 100%;
    }

    .grails-version-filter select {
        flex: 1;
    }
}
