/* style.css */

/* Globala stilar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

header, footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 15px;
}

/* Knappstilar */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background: #1b91f8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0268dc;
}

.logout {
    background: #555;
    color: white;
    padding: 8px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: 0.3s;
}

.logout:hover {
    background: #333;
}

.delete-btn {
    background: #d64b3b;
}

.delete-btn:hover {
    background: #a9372a;
}

/* Meddelanden */
.message {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
}

.error {
    color: red;
    background: #fdd;
    border: 1px solid red;
}

.success {
    color: green;
    background: #dfd;
    border: 1px solid green;
}

/* Login/Register/Change Password box */
.center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.box h2 {
    margin-bottom: 30px;
    color: #333;
}

.box label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    text-align: left;
}

.box input[type="text"],
.box input[type="password"],
.box input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.box button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #1b91f8;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.box button[type="submit"]:hover {
    background: #0268dc;
}

.box p {
    margin-top: 35px;
}

/* E-bookstore stilar */
.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.store-header .header-buttons {
    display: flex;
    gap: 10px;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.book-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
    display: flex;             
    flex-direction: column;     
    height: 100%; 
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-card img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.book-card h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.book-card p {
    margin-top: auto;
    color: #555;
}

.book-card .price {
    font-size: 1.5em;
    color: #d64b3b;
    font-weight: bold;
    margin-top: auto;
    margin-bottom: 10px;
    display: block;
}

.book-card .btn {
    padding: 10px 15px;
    font-size: 1em;
    margin-top: auto;
}

/* Kundvagn stilar */
.cart-container {
    max-width: 800px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.cart-total {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid #333;
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Användarsida stilar */
.user-info {
    text-align: center;
    margin-bottom: 30px;
}

.user-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.transaction-history {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

.transaction-history h2 {
    text-align: center;
    margin-bottom: 20px;
}

.transaction-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

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

.transaction-item .date {
    color: #777;
    font-size: 0.9em;
}

.transaction-item .amount {
    font-weight: bold;
    color: green;
}
