/* table.css */
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');

/* Button for adding an item */
.add-item-btn {
    margin-top: 20px;
    height: 45px;
    width: 200px;
    position: relative;
    overflow: hidden;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 10px; 
    text-align: center;
    margin-bottom: 20px;
}

/* Gradient background for the button */
.add-item-btn .inner {
    height: 100%;
    width: 300%;
    position: absolute;
    left: -100%;
    top: 0;
    z-index: 0;
    background: linear-gradient(to right, #bd5602, #c29f02, #bd5602, #c29f02);
    transition: all 0.4s;
    border-radius: 10px; 
}

/* Move the gradient in when hovered */
.add-item-btn:hover .inner {
    left: 0;
}

/* The button text shown over the gradient */
.add-item-btn button {
    height: 100%;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1; 
    cursor: pointer;
}

/* Table container styling */
.table-container {
    max-width: 1100px;
    margin: 0 auto;
    margin-top: 20px;
    padding: 20px;
    background-color: #333;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Add Item Button Styling */
.add-item-btn {
    margin-top: 20px;
    height: 45px;
    width: 200px; 
    position: relative;
    overflow: hidden;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.add-item-btn .inner {
    height: 100%;
    width: 300%;
    position: absolute;
    left: -100%;
    z-index: -1;
    background: linear-gradient(to right, #bd5602, #c29f02, #bd5602, #c29f02);
    transition: all 0.4s;
    border-radius: 10px;
}

.add-item-btn:hover .inner {
    left: 0;
}

.add-item-btn span {
    position: relative;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 1;
}

/* Login message styling */
.login-message {
    color: #ffda79;
    text-align: center;
    margin-top: 20px;
    font-size: 1.2em;
}

/* Styled Table */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    font-family: 'Roboto', sans-serif;
    color: #f4f4f4;
    margin-bottom: 20px;
    text-align: center;
}

.styled-table thead tr {
    background-color: #585858;
    text-align: center;
    color: #ffda79;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border: 1px solid #444;
    text-align: center;
    vertical-align: middle;
}

.styled-table tbody tr {
    border-bottom: 1px solid #444;
    background-color: #2a2a2a;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #222;
}

.styled-table tbody tr:hover {
    background-color: #383838da;
}

/* Checkbox Styling */
.control--checkbox {
    position: relative;
    display: inline-block;
}

.control--checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.control--checkbox .control__indicator {
    position: relative;
    width: 18px;
    height: 18px;
    background: #e6e6e6;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    margin-right: 10px;
}

.control--checkbox input[type="checkbox"]:checked ~ .control__indicator {
    background: #c29f02;
    border: 1px solid #bd5602;
}

.control--checkbox .control__indicator:after {
    content: '';
    position: absolute;
    display: none;
}

.control--checkbox input[type="checkbox"]:checked ~ .control__indicator:after {
    display: block;
}

.control--checkbox .control__indicator:after {
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.726);
}

.modal-content {
    background: #fff;
    width: 410px;
    padding: 30px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
}

.modal-content h2 {
    color: rgba(0, 0, 0, 0.8);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
}

.modal-content label {
    display: inline-block;
    width: 20%;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.8);
}

.modal-content input[type="text"],
.modal-content select {
    width: 100%;
    padding: 10px;
    margin: 8px 0 10px 0;
    border-radius: 5px;
    border: 1px solid silver;
    font-size: 0.9em;
}

#itemDescription {
    width: 95%; 
}

/* Modal button styling */
.modal-content .btn {
    margin-top: 20px;
    height: 45px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: none;
    border: none;
    cursor: pointer;
}

.modal-content .btn .inner {
    height: 100%;
    width: 300%;
    position: absolute;
    left: -100%;
    z-index: -1;
    background: linear-gradient(to right, #bd5602, #c29f02, #bd5602, #c29f02);
    transition: all 0.4s;
}

.modal-content .btn:hover .inner {
    left: 0;
}

.modal-content .btn button {
    height: 100%;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.close {
    color: #333;
    float: right;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Dropdown styling for selecting character */
.character-dropdown-wrapper {
    margin-bottom: 20px; 
}

.character-dropdown-label {
    font-size: 1.2em;
    color: #ffda79; 
    margin-right: 10px;
}

.character-dropdown {
    padding: 10px;
    font-size: 1em;
    border-radius: 5px;
    border: 1px solid #ccc; 
    background-color: #333; 
    color: #f4f4f4; 
}

.character-dropdown:focus {
    border-color: #ff9933; 
    outline: none; 
}

.character-control-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 20px auto; 
    padding: 10px;
}

.character-dropdown-wrapper {
    flex: 1;
    margin-right: 20px; 
}

.character-dropdown-label {
    font-weight: bold;
    color: #ffda79;
    margin-right: 10px;
}

.character-dropdown {
    width: 80%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}

.button-container {
    flex: 0;
}

/* Styling for suggestions box */
.suggestions-box {
    border: 2px solid #868686;
    border-image-slice: 1;
    box-shadow: 0 4px 8px rgb(0, 0, 0);
    background-color: #333; 
    color: #f4f4f4; 
    max-height: 150px; 
    overflow-y: auto;  
    position: absolute;
    width: 85%; 
    z-index: 1000; 
    border-radius: 8px;
    padding: 5px;
    margin-top: -6px; 
    display: none; 
}
  
/* Styling for each suggestion */
.suggestion-item {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 3px;
    border: 1px solid transparent; 
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Lighter color on hover for better visual feedback, similar to dropdown effect */
.suggestion-item:hover {
    background-color: #444; 
    border: 1px solid #ff9933; 
}

.suggestion-item img {
    margin-right: 10px;
    border-radius: 3px;
}

.selected-item-icon {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    position: absolute;
    right: 10px; 
    width: 30px;
    height: 28px;
}

/* Container to include input with icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input[type="text"] {
    padding-right: 40px;
    width: 100%;
}

.selected-item-icon img {
    width: 90%;
    height: auto;
}

/* ---------------------- delete confirmation modal -----------------------*/

/* Styling for delete confirmation modal */
.modal-content .btn-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.confirm-btn {
    background-color: #ff4d4d;
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.confirm-btn:hover {
    background-color: #a00101;
}

.cancel-btn {
    background-color: #ccc;
    border: none;
    padding: 10px 20px;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
}

.cancel-btn:hover {
    background-color: #999;
}

/* ------------------------ Table buttons ------------------------ */

/* General styling for all buttons in the table */
.action-button {
    padding: 0; 
    margin-right: 8px; 
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 20px;
    background: none; 
    cursor: pointer;
    border: none; 
}

/* Specific styling for each button */
.received-button {
    color: #4CAF50; 
}

.edit-button {
    color: #ffa500; 
}

.delete-button {
    color: #ff4d4d; 
}

.undo-button {
    color: #2196F3; 
}

.undo-button:hover {
    color: #1976D2; 
}

/* ------------------------ Received effects ------------------------ */

/* Glow effect */
.glow-effect {
    animation: glow 2s ease-out;
    z-index: 0;
    position: relative;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px #bd5602, 0 0 20px #ffda79;
    }
    100% {
        box-shadow: 0 0 0px transparent;
    }
}

/* Checkmark animation */
.checkmark {
    display: inline-block;
    color: #00ff00;
    font-size: 1.4em;
    animation: checkmarkAnimation 1s ease-out;
}

@keyframes checkmarkAnimation {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Transparent row */
.item-row.completed {
    background-color: #2a2a2a;
    opacity: 0.6;
}

.item-row .received-button {
    display: none;
}

.item-row .received-text {
    display: inline-block;
    color: #00ff00;
    font-weight: bold;
}

/* Specific hover for rows with glow effect */
.styled-table tbody tr.glow-effect:hover {
    background-color: #2a2a2a;
    box-shadow: none;
}

/* ------------------------ Progress bar ------------------------ */

.progress-container {
    margin-bottom: 20px;
    text-align: left;
}

.progress-bar {
    width: 95%;
    margin: 0 auto;
    background-color: #585858;
    border-radius: 15px;
    overflow: hidden;
    height: 20px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #ff8800, #22dd88);
    width: 0%;
    transition: width 0.5s ease-in-out;
}

#progressText {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #ffda79;
    text-align: center;
}