* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
:root {
    --main-color:#3AB8FF;
    --main-color-darker: #0072b4;
}
html {
    scroll-behavior: smooth;
}
body {
    background: #000;
    color: #fff;
}

.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}
/* ---------------------header------------------- */
#header {
    width: 100%;
}

.container {
    padding: 10px 10%;
}

/* start nav style */

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* start logo animation and style */

#logo {
  overflow: hidden;
  display: inline-block;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}
#logo:hover span {
    opacity: 1;
}

.logoMainText {
    display: inline-block;
    vertical-align: baseline;
    font-weight: bold;
    color: var(--main-color);

    font-size: 60px;
}
.logoSubText {
    transition: width 0.3s ease-out, opacity 0.3s ease-out;
    width: 0;
    opacity: 0;
    display: inline-block;
    vertical-align: baseline;
    overflow: hidden;

    font-size: 40px;
}

/* end logo animation and style */

nav ul li {
    display: inline-block;
    list-style: none;
    margin: 10px 20px;
}
nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    position: relative;
}
nav ul li a::after {
    content: '';
    width: 0;
    height: 3px;
    background: var(--main-color);
    position: absolute;
    left:0;
    bottom: -6px;
    transition: 0.3s;
}
nav ul li a:hover::after {
    width: 100%;
}

/* end nav style */

/* ---------------------portfolio----------------- */

#portfolio {
    padding-top: 50px;
}


/* --- SEARCH BAR STYLES --- */

.work-header {
    margin-top: 50px;
    width:100%;
}

/* --- NEW SEARCH BAR STYLES AND SORT BUTTONS --- */
.search-container {
    margin-top: 30px;
    display: flex;
    width: 90%;
    max-width: 700px; /* Increased max-width for better separation */
    margin-bottom: 30px;
    background-color: var(--dark-input);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a3a;
    padding: 8px; /* Adjusted padding */
    align-items: center;
    /* KEY CHANGE: Pushes first element (search) to the left and second (sort) to the right */
    justify-content: space-between; 
}

.search-field-group {
    display: flex;
    flex-grow: 1;
    /* Allow it to grow but cap the size so sort buttons don't get pushed too far */
    max-width: 450px; 
    background-color: #333; /* Slightly darker background for the input area */
    border-radius: 8px;
    overflow: hidden;
    margin-right: 20px;
}

.search-input {
    flex-grow: 1;
    padding: 10px 15px; /* Slightly adjusted padding */
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
}

.search-input::placeholder {
    color: #777;
}

.search-button {
    background: none;
    border: none;
    padding: 10px 12px; /* Smaller padding */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.search-button:hover {
    background-color: #444; /* Hover darker gray */
    color: white;
}

.search-icon {
    width: 20px; /* Slightly smaller icon */
    height: 20px;
    fill: currentColor;
}

/* NEW SORT BUTTON STYLES */
.sort-buttons {
    display: flex;
    overflow: hidden; 
    border-radius: 8px;
    border: 1px solid var(--main-color); /* Highlight the group */
    line-height: 1;
    /* Ensure the sort buttons stay compact on the right */
    flex-shrink: 0; 
}

.sort-button {
    background-color: #3a3a3a; /* Inactive background */
    color: #bbb;
    border: none;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.sort-button:hover:not(.active) {
    background-color: #555;
    color: white;
}

.sort-button.active {
    background-color: var(--main-color);
    color: white;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4);
}

.sort-button:first-child {
    border-right: 1px solid var(--main-color); /* Separator */
}

.sort-button.active:first-child {
    border-right: 1px solid #ffffff33; /* Separator when active */
}

/*******************************************/

.sub-title {
    font-size: 60px;
    font-weight: 600;
    color: #fff;
}

.work-list {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    grid-gap: 40px;
    margin-top: 20px;
    border-top: 2px dotted var(--main-color);
}

.work {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border-radius: 10px;
    text-align: center;
    margin: 1em 0;
    transition: transform 0.3s;
}
.helper {
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.work img {
    width: auto;
    vertical-align: middle;
    transition: transform 0.3s;
    max-width: 450px;
    border-radius: 10px;
}
.layer {
    width: 100%;
    height: auto;
    max-height: 100px;
    background: linear-gradient(rgba(0,0,0,0.6), black);
    border-top: 2px solid var(--main-color);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    /*justify-content: center;*/
    align-items: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    font-size: 14px;
    transition: max-height 0.3s;
    white-space: wrap;
}
.layer h3 {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 20px;
    width:100%;
    margin-top:20px;
}
.layer p {
    opacity: 0;
    transition: opacity 0.3s 0.1s;
}
.layer a {
    opacity: 0;
    transition: opacity 0.3s 0.1s;
}

.layer .tag-holder {
    width:100%;
}

.layer .tag {
    margin-right: 10px;
    margin-left: 10px;
    margin-bottom: 20px;
    background:rgb(84, 84, 84);
    border: 1px solid rgb(61, 61, 61); 
    border-radius: 20px;
    font-size: 14px;
    width:fit-content;
    float: left;
    padding: 5px;    
}

.layer .projectLink {
    margin-top: 20px;
    color: var(--main-color-darker);
    text-decoration: none;
    font-size: 18px;
    line-height: 60px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
}
.projectDescriptionLink {
    color: #fff;
    text-decoration: underline;
}
.work:hover img {
    transform: scale(1.1);
}
.work:hover .layer {
    max-height: 80%;
}
.work:hover .layer p {
    opacity: 1;
}
.work:hover .layer a {
    opacity: 1;
}

.copyright {
    width: 100%;
    text-align: center;
    padding: 25px;
    background: #262626;
    font-weight: 300;
    margin-top: 20px;
    color: #ababab
}


/* ---------------------- Snall screens --------------------- */

@media only screen and (max-width: 600px) {

    .logoMainText {
        font-size: 40px;
    }
    .logoSubText {
        font-size: 28px;
    }

    .sub-title {
        font-size: 40px;
    }

    #portfolio {
        padding-top: 20px;
    }

    .work-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .copyright {
        font-size: 14px;
    }
}