:root {
    --primary: #179B4C;
    --black: #333;
}

* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.4;
    min-width: 320px;
}
body {
    background: #fff;
    font-family: sans-serif;
    font-weight: 400;
    color: var(--black);
}

dialog {
    max-width: 600px;
    border-radius: 3px;
}

a {
    color: var(--primary);
    text-decoration: none;
}
    a:hover {
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 5px;
        color: var(--black);
    }

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
    margin: 10px 0 30px 0;
}

h1 {
    font-size: 2rem;
}
h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}
h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

h4 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

p {
    margin: 0.5rem 0 1.1rem 0;
}

hr {
    background: #ddd;
    border: 0;
    height: 1px;
    margin: 45px 0;
}

fieldset {
    padding: 0;
    margin: 0;
    border: 0;
}

select {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 100%;
    background: #fff;
    color: var(--black);
}
select:focus {
    border-color: var(--primary);
    outline: none;
}

input {
    accent-color: var(--black);
}

table {
    border-collapse: collapse;
    width: 100%;
    border-radius: 5px;
}
    th, td {
        padding: 8px 20px;
        text-align: left;
        vertical-align: top;
    }
    th {
        background: #f4f4f4;
    }
    td {
        background: #fff;
    }

.table-wrap {
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: auto;
}

code {
    padding: 0 10px;
    border-radius: 10px;
}
    pre {
        border-radius: 10px;
        max-width: 100%;
    }
    pre code {
        display: block;
        overflow: scroll;
        max-height: 50vh;
    }
    code:not(pre code) {
        background: #edfbf3;
        display: inline-block;
    }
sup a {
    text-decoration: none;
    padding: 0;
    text-decoration-thickness: 0;
    text-underline-offset: 0;
}

input[type=text], input[type=url], textarea {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 100%;
}
button {
    font-size: 1rem;
    border: 0;
    cursor: pointer;
}

ul.flat {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

button, .button {
    background: var(--black);
    text-decoration: none;
    color: #fff;
    display: inline-block;
    padding: 15px 40px;
    border-radius: 30px;
    border: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
    button:hover,
    .button:hover {
        background: var(--primary);
        color: #fff;
        text-decoration: none;
    }
    .button img {
        height: 20px;
        margin-right: 5px;
        display: inline-block;
        vertical-align: middle;
        filter: brightness(0) invert(1);
    }

.button-outline {
    background: none;
    border: 2px solid var(--black);
    color: var(--black);
    padding: 13px 38px;
}
    .button-outline:hover {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

button.small {
    font-size: 0.875rem;
    padding: 10px 20px;
}

.icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0.55;
}

.icon-button:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.icon-button img {
    max-height: 18px;
    vertical-align: middle;
}

@keyframes shake {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(1em);
    }
    40% {
        transform: translate(-1em);
    }
    60% {
        transform: translate(0.5em);
    }
    80% {
        transform: translate(-0.5em);
    }
    100% {
        transform: translate(0);
    }
}


.autocomp {
    background: #f8f8f8;
    border-radius: 0 0 5px 5px;
    border: 1px solid #ccc;
    border-top: 0;
    box-shadow: 2px 2px 2px #eee;
    text-align: left;
}
.autocomp-item {
    padding-bottom: 5px;
    padding: 10px;
    cursor: pointer;
}
.autocomp-item:hover,
.autocomp-sel {
    background: #f1f1f1;
    font-weight: bold;
}

.ellip {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
}
.box {
    box-shadow: 1px 1px 4px #eee;
    border-radius: 5px;
    border: 2px solid #eee;
    padding: 15px 20px;
}
    .text-small {
        font-size: 0.875rem;
    }
    .text-grey {
        color: #888;
    }

.light {
    opacity: 0.4;
}

.tags a {
    display: inline-block;
    margin-right: 10px;
}
    .tags a:hover {
        color: var(--primary);
    }

.align-right {
    text-align: right;
}

.message {
    background: #fffaf0;
    border: 1px solid #f8c481;
    color: #ae7a13;
    padding: 15px;
}
.error {
    background: #fbefef;
    color: #b23f3f;
    border: 1px solid #fecaca;
}
.success {
    background: #ecfff4;
    color: var(--primary);
    border: 1px solid #aee1c3;
}

.pagination {
  margin-top: 30px;
}
  .pagination a {
    display: inline-block;
    text-decoration: none;
  }
  .pagination .pg-page {
    padding: 0 6px;
  }
  .pagination .pg-selected {
    font-weight: bold;
    border-bottom: 2px solid var(--primary);
  }
  .pagination.top {
    margin-bottom: 30px;
  }
  .pagination.bottom {
    margin-top: 30px;
  }

.mast {
    background: #f8f8f8;
}
    .mast .tabs .tab {
        background: #eee;
        display: inline-block;
        margin-right: 5px;
        max-width: 225px;
    }
    .mast .tabs .tab:hover span {
        text-decoration: underline;
    }
    .mast .tabs .tab.sel {
        background: #fff;
    }
    .mast .tabs .tab span {
        padding: 10px 30px 4px 30px;
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1;
    }

.main {
    margin-top: 45px;
    margin-bottom: 30px;
}

.container-fluid {
    max-width: 1200px;
}

.header {
    padding: 20px 0 0 0;
    overflow: hidden;
}
    .header .bar {
        margin-bottom: 20px;
    }
        .header .nav a {
            margin-left: 30px;
            text-decoration: none;
        }
    .header .title {
        margin: 0 0 30px 0;
    }
    .header .heading .title {
        margin: 0;
    }
    .header .subheading {
        margin-bottom: 30px;
    }

.logo img {
    max-height: 32px;
    transition: transform 0.7s ease-in-out;
    margin-right: 10px;
    vertical-align: middle;
}
    .logo img:hover {
      transform: rotate(30deg); /* Full rotation on hover */
    }
    .logo a {
        text-decoration: none;
        color: var(--black);
    }

    .intro .title {
        margin: 0 0 15px 0;
    }
    .intro h2 {
        margin: 0 0 15px 0;
    }
    .intro p {
        color: #777;
        font-size: 1.1rem;
    }
    .intro .name span {
        color: var(--primary);
    }
    .intro code {
        padding: 0;
        background: none;
    }

.search {
    margin-bottom: 30px;
    position: relative;
}
    .search .more {
        display: none;
    }
    .search:has(#type-project:checked) .more {
      display: block;
    }
    .search .input {
        margin-bottom: 8px;
        display: flex;
    }
    .search .input input {
        border-radius: 5px 0 0 5px;
        border: 2px solid #ccc;
    }
    .search button {
        border-radius: 0 5px 5px 0;
    }
    .search .q {
        padding: 10px;
    }
    .search .tabs {
        font-size: 0.875rem;
        margin-left: 10px;
        margin-bottom: -1px;
        z-index: 2;
    }
    .search .tabs .tab {
        border: 1px solid #ddd;
        border-bottom: 0;
        border-radius: 3px 3px 0 0;
    }
    .search .tabs .tab span {
        padding: 6px 15px 3px 15px;
    }
    .search label {
        cursor: pointer;
    }

table .filter {
    display: flex;
}

    table .filter button {
        border-top-left-radius: 0px;
        border-bottom-left-radius: 0px;
    }

    table .filter input {
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;

        padding-top: 0;
        padding-bottom: 0;
    }

.home .updates .block {
    margin-top: 60px;
}
    .home .recent-projects > .title {
        margin: 0 0 30px 0;
    }
    .home .updates .block:last-child {
        margin-bottom: 0;
    }
    .home .top-tags {
        line-height: 1.7;
    }

.validate textarea {
    height: 50vh;
}
.validate .message {
    display: none;
}

/* Search results */
.results ul {
    list-style-type: none;
    padding: 0;
}
    .results .result {
        margin-bottom: 20px;
        padding-bottom: 30px;
        /* padding: 20px; */
        border-bottom: 1px solid #eee;
    }
    .results .result:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }
    .results .title {
        margin: 0 0 5px 0;
        display: inline-flex;
        align-items: center;
    }
    .results .title h4 {
        margin: 0 15px 0 0;
    }
    .results .title .meta img {
        margin: 0;
    }
    .results .description {
        margin: 0 0 10px 0;
    }
    .results p:last-child {
        margin-bottom: 0;
    }
        .results .props .license {
            vertical-align: top;
            line-height: 1;
        }
        .results .props img {
            max-height: 18px;
            vertical-align: top;
            transition: scale 0.1s ease-in-out;
        }
        .results .props a {
            display: inline-block;
            margin-left: 15px;
            text-decoration: none;;
        }
        .results .props a:hover {
            opacity: 1;
        }
        .results footer.meta {
            font-size: 0.9rem;
            display: inline-flex;
        }
        .results footer.meta .license {
            margin-right: 20px;
            display: inline-block;
            background-color: #eee;
            padding: 1px 6px;
            border-radius: 3px;
        }
    .meta a {
        color: #888;
        text-decoration: none;
    }
    .meta a:hover {
        color: var(--black);
    }
    .meta .item {
        margin: 0 0 10px 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .meta img {
        max-height: 18px;
        vertical-align: middle;
        margin-right: 5px;
    }
    .meta img .link-icon {
        opacity: 0.5;
    }


.project .props .block {
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
    margin-bottom: 30px;
}
    .project .props .link {
        display: block;
        margin-bottom: 10px;
    }
    .project .props .block:last-child {
        border: 0;
        margin-bottom: 0;
    }
    .project .block .title {
        margin: 0 0 15px 0;
    }

.plans {
    margin-bottom: 60px;
}
    .plans .amount {
        text-align: right;
    }
    .plans .channel-type ul {
        margin: 0;
        padding: 0 0 0 15px;
    }

.channels tr:target td {
   background-color: #ecfff4;
   font-weight: 500;
   animation: shake 200ms ease-in-out;
   animation-iteration-count: 2;
}

/* Browse directory */
.browse .order select {
    display: inline-block;
    width: auto;
}

.footer {
    color: #999;
    font-size: 0.875rem;
    margin-top: 5vh;
    margin-bottom: 15px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}
    .footer a {
        text-decoration: none;
    }

.container-fluid.floating {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
}

.container-fluid.floating:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.3rem;
    color: var(--black);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    padding: 0;
}

.modal-close:hover {
    color: var(--black);
}

.modal-close:checked ~ .modal-overlay {
    display: flex;
}


.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.modal-footer button {
    margin-left: 10px;
}

.modal-toggle {
    display: none;
}

.modal-overlay {
    display: none;
}

.modal-toggle:checked ~ .modal-overlay {
    display: flex;
}

@media (max-width: 520px) {
    .modal {
        width: 95%;
    }

    .container-fluid.floating {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .container-fluid {
        padding: 15px;
        margin: 0;
    }
    .row {
        margin-right: 0;
        margin-left: 0;
    }
    .header {
        padding: 10px 0 0 0;
    }
    .header .logo {
        text-align: center;
    }
    .header .nav {
        text-align: center;
    }
    .header .nav a {
        margin: 0 10px;
    }
    .header .heading {
        margin-bottom: 15px;
    }
    .header .subheading {
        margin-bottom: 0px;
    }
    .search {
        margin-bottom: 30px;
    }
    .intro {
        margin: 0;
    }
    .mast .tabs .tab {
        display: block;
        width: 100%;
        max-width: none;
        border-bottom: 1px solid #ccc;
    }
    .mast .tabs .tab span {
        padding: 8px 15px;
    }
    .mast .tabs .tab:last-child {
        border-bottom: 0;
    }

    .results .title {
        margin: 0;
        display: block;
    }
    .results .props a {
        margin: 0 10px 0 0;
    }
 }
