/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    align-items: flex-end; /* Slide up from bottom */
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    width: 100%;
    max-width: 480px;
    height: 80vh; /* Takes up 80% of height */
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px;
}

.tab-item {
    padding: 15px 15px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-item.active {
    color: #00bcd4;
    border-bottom-color: #00bcd4;
    font-weight: bold;
}

.modal-body {
    padding: 10px 0;
    overflow-y: auto;
    flex: 1;
}

/* List Items */
.library-group-title {
    padding: 15px 25px 5px;
    font-size: 14px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    background-color: #fafafa;
    position: sticky;
    top: 0;
}

.library-item {
    padding: 15px 25px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.library-item:hover {
    background-color: #f9f9f9;
}

.library-item.selected {
    background-color: #e0f7fa;
}

.library-item.selected .item-name {
    color: #006064;
    font-weight: bold;
}

.item-icon {
    width: 40px;
    height: 40px;
    background-color: #e0f2f1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #009688;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.item-id {
    font-size: 12px;
    color: #999;
}

.check-icon {
    color: #00bcd4;
    display: none;
}

.library-item.selected .check-icon {
    display: block;
}
