@import url('./style.css');

/* ------------------------- Add */

.AddBookpage {
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    padding: 30px;
    margin-top: 30px;
    background-color: #f1f1f1;
}

.AddBookForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
    
    h1 {
        color: #2c3e50;
        text-align: center;
        margin-bottom: 30px;
        font-size: 2rem;
    }
    
    div {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    label {
        font-weight: 500;
        color: #2c3e50;
    }
    
    textarea {
        min-height: 120px;
        resize: vertical;
        font-size: 1rem;
        padding: 10px;
        line-height: 1.4;
        width: 100%;
        border: 1px solid #ddd;
        border-radius: 4px;
        transition: all 0.3s ease-in-out;
    }
    
    textarea:focus {
        border-color: var(--fourth-color);
        box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.2);
        outline: none;
    }
    
    select {
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        transition: all 0.3s ease-in-out;
    }
    
    input[type="text"], input[type="number"],
    input[type="text"] {
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        transition: all 0.3s ease-in-out;
    }
    
    input[type="text"]:focus, input[type="number"]:focus,
    input[type="text"]:focus, select:focus {
        border-color: var(--fourth-color);
        outline: none;
    }
}

.FormBtn {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.AddBtn {
    border: none;
    background-color: var(--fourth-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    color: var(--third-color);
}

.AddBtn:hover {
    background-color: var(--first-color);
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    color: white;
}

/* -------------------------Edit */

.EditBookpage {
    background-color: #f1f1f1;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    padding: 30px;
    margin-top: 30px;
}

.EditBookForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
    
    h1 {
        color: #2c3e50;
        text-align: center;
        margin-bottom: 30px;
        font-size: 2rem;
    }
    
    div {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    label {
        font-weight: 500;
        color: #2c3e50;
    }
    
    textarea {
        min-height: 120px;
        resize: vertical;
        font-size: 1rem;
        padding: 10px;
        line-height: 1.4;
        width: 100%;
        border: 1px solid #ddd;
        border-radius: 4px;
        transition: all 0.3s ease-in-out;
    }
    
    textarea:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.2);
        outline: none;
    }
    
    select {
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        transition: all 0.3s ease-in-out;
        background-color: white;
    }
    
    input[type="text"], input[type="number"],
    input[type="text"] {
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        transition: all 0.3s ease-in-out;
    }
    
    input[type="text"]:focus, input[type="number"]:focus,
    input[type="text"]:focus, select:focus{
        border-color: var(--fourth-color);
        outline: none;
    }
}

.FormBtn {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.EditBtn {
    border: none;
    background-color: var(--fourth-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    color: var(--third-color);
}

.EditBtn:hover {
    background-color: var(--first-color);
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    color: white;
}

/* ------------------------- nav-icons */

#menu-icon {
    display: none;
}

/* -------------------------------------------- Manage Books */

#Books {
    width: 100%;
    text-align: center;
    margin: 10rem auto;
    max-width: 1300px;
    padding: 0px 35px;

    .logoPage {
        width: 150px;
        margin-bottom: 10px;
    }

    .marginTitle {
        font-style: italic;
        color: dimgray;
    }

    .booktype {
        .addBookBtn {
            border: none;
            background-color: var(--fourth-color);
            color: white;
            font-size: 1rem;
            font-weight: 600;
            padding: 10px 20px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease-in-out;
        }

        .addBookBtn:hover {
            background-color: var(--first-color);
            box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
        }

        .header-container{
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            margin-top: 50px;
        }

        h2 {
            color: var(--first-color);
            font-weight: bold;
            text-align: left;
            font-size: 30px;
            margin: 2rem;
            margin-left: 0px;
        }

        h5{
            font-weight: bold;
        }

        .cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 25px;

            .card {
                display: flex;
                justify-content: space-between;
                flex-direction: column;
                gap: 25px;
                padding: 1rem;
                max-width: 350px;
                border-radius: 40px;
                overflow: hidden;
                position: relative;
                transition: all 0.3s ease-in-out;

                img {
                    width: 100%;
                    height: auto;
                    object-fit: cover;
                    border-radius: 5px;
                    margin: auto;
                    transition: all 0.3s ease-in-out;
                }

                p {
                    font-style: italic;
                    color: rgb(48, 48, 48);
                }

                .cardBtn {
                    display: flex;
                    justify-content: left;
                    gap: 20px;
                    background: var(--fourth-color);
                    color: var(--third-color);
                    font-size: 20px;
                    font-weight: bold;
                    border: none;
                    margin-left: auto ;
                    position: absolute;
                    top: 15px;
                    left: 15px;
                    opacity: 0;
                    padding: 7.5px;
                    border-radius: 5px;
                    cursor: pointer;
                    transition: all 0.3s ease-in-out;
                }

                .cardBtn:hover {
                    background: var(--first-color);
                    transition: all 0.3s;
                    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
                    transform: scale(1.05);
                }
            }

            .card:hover {
                transform: scale(1.015);
                img {
                    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
                }
                .edit, .delete{
                    opacity: 1;
                }
                .delete{
                    margin-top: 50px;
                }
            }
        }
    }

    .availability {
        display: inline-block;
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 0.8em;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .available {
       background-color: #4CAF50;
       color: white;
    }
    
    .unavailable {
       background-color: #f44336;
       color: white;
    }
    
    .due-date {
       font-size: 0.8em;
       color: #666;
       margin-top: 3px;
    }
}

/* ------------------------------------------------------------------------------------- RESPONSIVE PART */
/* -------------------------------------------- header */
@media screen and (max-width: 1024px) {

    /* ------------------------- logo */

    .header h3 {
        font-size: 1rem;
    }

    /* ------------------------- search-bar */

    .search-bar input {
        width: 300px;
        height: 35px;
        font-size: 13px;
    }

    .search-bar input::placeholder {
        font-size: 13px;
    }

    .search-bar a{
        top: 5px;
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 768px) {

    /* ------------------------- header */

    .header section {
        padding: 0 15px;
        
        /* ------------------------- logo */

        h3 {
            font-size: 0.8rem;
        }
    }

    /* ------------------------- search-bar */

    .search-bar input {
        width: 170px;
        height: 30px;
        font-size: 11px;
        padding: 0 0 0 25px;
    }

    .search-bar input::placeholder {
        font-size: 11px;
    }

    .search-bar a{
        top: 7px;
        font-size: 0.8rem;
    }

    /* ------------------------- icons */

    .home-manage-profile-logout-icons i,
    .nav-buttons i,
    #menu-icon {
        font-size: 20px;
    }

    .home-manage-profile-logout-icons {
        gap: 5px;
    }
}

@media screen and (max-width: 425px) {

    /* ------------------------- icons */

    #menu-icon {
        display: block;
        cursor: pointer;
    }

    .home-manage-profile-logout-icons {
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        width: 20%;
        height: auto;
        padding: 30px 0;
        backdrop-filter: blur(20px);
        border-left: 2px solid var(--first-color);
        border-bottom: 2px solid var(--first-color);
        display: none;
    }

    :has(#menu-toggle:checked) .home-manage-profile-logout-icons {
        display: block;
    }

    .home-manage-profile-logout-icons a {
        display: block;
        font-size: 1rem;
        margin: 0.5rem 0;
        color: var(--first-color);
    }
}

/* -------------------------------------------- Manage Books */

@media screen and (max-width: 768px) {
    #Books {
        padding: 0px 30px;
        margin: 7.5rem auto 5rem;
        
        .booktype {
            .header-container {
                h2 {
                    font-size: 1rem;
                    width: fit-content;
                    margin: 2rem 0;
                }
                
                .addBookBtn {
                    font-size: 0.8rem;
                }
            }
            
            .cards {
                grid-template-columns: repeat(2, 1fr);
                
                .card {
                    padding: 0.5rem;
                    border-radius: 35px;
                }
            }
        }
    }
}

@media screen and (max-width: 425px) {
    #Books {
        .booktype {
            .header-container {
                .addBookBtn {
                    padding: 7.5px;
                }
            }
            
            .cards {
                grid-template-columns: repeat(1, 1fr);
            }
        }
    }
}
