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

/* -------------------------------------------- Book List Page */

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

    .logoPage {
        width: 150px;
        margin-bottom: 10px;
    }
    
    .marginTitle {
        font-style: italic;
        color: var(--first-color);
    }
    img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 10px;
        margin: auto;
        transition: all 0.3s ease-in-out;
    }
    
    .booktype {
        .header-container{
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            margin-top: 100px;
        }

        h2 {
            color: var(--first-color);
            font-weight: bold;
            text-align: center;
            font-size: 30px;
            margin-top: 5rem;
            margin-bottom: 2rem;
        }
    
        h5{
            color: var(--third-color);
            font-weight: bold;
        }
        
        .cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            row-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;
                }
                
                .card-actions{
                    margin-top: 25px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    gap: 5px;

                    a{
                        .borrow-btn{
                            border: none;
                            background-color: var(--fourth-color);
                            font-weight: 600;
                            padding: 10px 20px;
                            border-radius: 10px;
                            cursor: pointer;
                            transition: all 0.3s ease-in-out;
                            color: var(--third-color);
                            i {margin-right: 0.5rem;}
                        }
                        .borrow-btn:hover{
                            background-color: var(--first-color);
                            box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
                            color: white;
                        }
                        
                        .Book-Review-btn {
                            border: none;
                            background-color: var(--fourth-color);
                            font-weight: 600;
                            padding: 10px 20px;
                            border-radius: 10px;
                            cursor: pointer;
                            transition: all 0.3s ease-in-out;
                            color: var(--third-color);
                            i {margin-right: 0.5rem;}
                        }
                        
                        .Book-Review-btn:hover {
                            background-color: var(--first-color);
                            box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
                            color: white;
                        }
                    }
                }
            }
            
            .card img:hover {
                transform: scale(1.015);
                box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
            }
        }
    }
    
    .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;
    }
}

/* -------------------------------------------- Book Review */

.r-p-main {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    align-content: center;
    
    .book-box {
        margin: auto;
        width: 70%;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: space-around;
        flex-wrap: wrap;
        padding: 35px 15px;
        border-radius: 15px;
        background-color: #f1f1f1;
        box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    
        .book-box-img{
            width: 400px;
            height: 400px;
            
            img{
                height: 100%;
                border-radius: 5px;
                box-shadow: rgba(0, 0, 0, 0.35) 0px 2.5px 5px;
                transition: all 0.5s;
            }
            
            img:hover{
                transform: scale(1.05);
                cursor: pointer;
                box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
            }
        }
        
        .book-box-content {
            display: flex;
            flex-direction: column;
            gap: 25px;
            text-align: left;
            
            h3{
                font-size: 25px;
                span {
                    color: var(--fourth-color);
                }
            }
            
            a{
                text-decoration: none;
                transition: all 0.3s ease-in-out;
                max-width: 50%;
                
                button {
                    border: none;
                    width: 100%;
                    background-color: var(--fourth-color);
                    color: var(--third-color);
                    font-size: 1rem;
                    font-weight: 600;
                    padding: 10px 20px;
                    border-radius: 10px;
                    cursor: pointer;
                    transition: all 0.3s ease-in-out;
                }
                
                button:hover {
                    background-color: var(--first-color);
                    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
                }
            }
        }
    }
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}
.status-badge.available {
    background-color: #d4edda;
    color: #155724;
}
.status-badge.unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

/* -------------------------------------------- Borrow-Page */

.borrow{
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    align-content: center;

    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0 auto;
        padding: 2.5rem;
        border-radius: 15px;
        max-width: 40%;
        background-color: #f1f1f1;
        box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;

        h1 {
            font-size: 2.5rem;
        }
        
        h1, label {
            color: var(--first-color);
        }
        
        form {
            width: 100%;
            .inputData {
                display: flex;
                flex-direction: column;
                gap: 1rem;
                margin: 3rem auto;
                .userName, .password{
                    display: flex;
                    flex-direction: column;
                    input {
                        border: 1px solid var(--first-color);
                        height: 40px;
                        padding: 0 10px;
                        font-size: 15px;
                        border-radius: 10px;
                        transition: all 0.35s ease;
                    }
                }
            }
            
            .formBtn {
                display: flex;
                flex-direction: column;
                justify-content: center;
                text-align: center;
                gap: 2rem;
            }
        }

        .buttons{
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2rem;

            button,a{
                border: none;
                text-align: center;
                background-color: var(--fourth-color);
                color: var(--third-color);
                font-size: 1rem;
                font-weight: 600;
                padding: 10px 20px;
                border-radius: 10px;
                cursor: pointer;
                transition: all 0.3s ease-in-out;
                width: 200px;
            }

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

/* -------------------------------------------- search page */

/* Search page styles */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
    
    h2 {
        font-size: 2rem;
        color: #333;
        margin-bottom: 0.5rem;
    }
}

.no-results {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 2rem 0;
    
    p {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
}

.browse-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
}

.browse-btn:hover {
    background: #0056b3;
}

/* -------------------------------------------- Profile */

.borrow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #cccccc;
}

.borrow-btn:disabled:hover::after {
    content: "This book is currently unavailable";
    position: absolute;
    background: #333;
    color: white;
    padding: 5px;
    border-radius: 3px;
    margin-top: -30px;
    margin-left: -50px;
    font-size: 12px;
}

#profilePage {
    min-height: calc(100vh - 7vh - 30vh);
    margin-top: 9vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    
    .profile-container {
        background-color: #f1f1f1;
        box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
        max-width: 800px;
        width: 90%;
        padding: 2.5rem;
        border-radius: 15px;
        margin: 2rem auto;
        
        .profile-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--first-color);
            padding-bottom: 1rem;
            
            .profile-title {
                font-size: 1.8rem;
                color: #4f88ba;
                font-weight: 700;
            }
            
            .profile-avatar {
                width: 80px;
                height: 80px;
                border-radius: 50%;
                background-color: var(--first-color);
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 2rem;
                color: white;
                font-weight: 700;
            }
        }
    }
}

.profile-section {
    margin-bottom: 2rem;
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        color: var(--fourth-color);
        font-weight: 600;
    }
    
    .profile-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
    
    label {
        display: block;
        margin-bottom: 0.8rem;
        font-weight: 600;
        color: var(--fourth-color);
    }
    
    input, select {
        width: 100%;
        padding: 0.8rem 1rem;
        border: 1px solid var(--first-color);
        border-radius: 10px;
        font-size: 1rem;
        transition: all 0.35s ease;
    }
    
    input:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(var(--first-color-rgb), 0.2);
    }
    
    .gender-options {
        display: flex;
        gap: 1.5rem;
        align-items: center;
        
        .gender-option {
            display: flex;
            align-items: baseline;
            gap: 0.5rem;
        }
    }
}

.reading-goal {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid #ddd;
    
    .goal-progress {
        margin-top: 1.5rem;
        height: min-content;
        background: #e0e0e0;
        border-radius: 6px;
        overflow: hidden;
        
        .progress-bar {
            height: 100%;
            background: var(--fourth-color);
            width: 0%;
            transition: all 0.35s ease-in-out;
        }
    }
    
    .progress-text {
        margin-top: 0.5rem;
        font-size: 0.9rem;
        color: #4f88ba;
        text-align: center;
    }
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.btn-primary {
    background-color: var(--fourth-color);
    color: white;
}

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

.btn-secondary {
    background-color: #f0f0f0;
    color: #4f88ba;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.full-width {
    grid-column: 1 / -1;
}

/* ------------------------------------ Borrowed Books */

.borrowed-books-container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f1f1f1;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    
    h1 {
        color: #2c3e50;
        margin-bottom: 1.5rem;
        text-align: center;
    }
}

.borrowing-info {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.1rem;
}

.borrowed-count {
    font-weight: bold;
    color: var(--fourth-color);
}

.borrowed-book-card {
    display: flex;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.book-cover {
    width: 150px;
    align-content: center;
    margin-left: 1.5rem;
        
    img {
        width: 100%;
        object-fit: cover;
    }
}

.book-details {
    flex: 1;
    padding: 1.5rem;
    
    h3 {
        margin-top: 0;
        color: #2c3e50;
    }
    
    .author {
        color: #7f8c8d;
        margin-bottom: 1rem;
    }
}

.borrowing-info p {
    margin: 0.5rem 0;
    color: #34495e;
}

.reading-progress h2 {
    margin: 2rem 0rem;
    color: #2c3e50;
}

.progress-container {
    height: min-content;
    background: white;
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--fourth-color);
    text-align: center;
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.time-left {
    font-weight: bold;
}

.time-left.overdue {
    color: #e74c3c;
}

.book-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.return-btn, .renew-btn {
    border: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    background-color: var(--fourth-color);
    color: var(--third-color);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.return-btn {
    background: #3498db;
    color: white;
}

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

.renew-btn {
    background: #2ecc71;
    color: white;
}

.renew-btn:hover {
    background: #27ae60;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.no-books-message {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    margin-top: 2rem;
    
    p {
        margin-bottom: 1rem;
        color: #606667;
    }
}

.login-btn, .browse-books-btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    background-color: var(--fourth-color);
    color: var(--third-color);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

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

/* -------------------------------------------- Borrowed Books */

.reserve-btn {
    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;
    i {margin-right: 0.5rem;}
}

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

/* ------------------------------------------------------------------------------------- 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);
    }
}


/* -------------------------------------------- List Page */





/* -------------------------------------------- Book Review */

@media screen and (max-width: 425px){
    
    .r-p-main .book-box .book-box-img{
        width: 250px;
        height: 250px;

        img{
            width: 100%;
        }
    }
}

/* -------------------------------------------- Profile */





/* -------------------------------------------- Borrowed Books */

