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

body {
    background: #e6f0fa url('') no-repeat center/cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    touch-action: manipulation;
}

.time-section {
    color: #fff;
    text-align: center;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-section #timeDisplay {
    font-size: 48px;
    font-weight: 300;
}

.time-section #dateDisplay {
    font-size: 16px;
    margin-top: 5px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    align-items: center;
}

div.search-bar input#searchInput {
    flex: 1;
    padding: 10px 15px;
    border: none !important;
    border-radius: 25px !important;
    background: #fff !important;
    font-size: 16px;
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    color: #000 !important;
    caret-color: #4a90e2 !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
}

div.search-bar input#searchInput::placeholder {
    color: #888 !important;
}

div.search-bar input#searchInput:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #4a90e2 !important;
    background: #f9f9f9 !important;
}

.search-bar select {
    padding: 10px;
    border: none;
    border-radius: 25px;
    background: #fff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%23357abd"><path d="M7.293 4.707a1 1 0 0 1 1.414 0L10 6.586l1.293-1.293a1 1 0 1 1 1.414 1.414l-2 2a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 0-1.414z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.search-bar button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: #4a90e2;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #357abd;
}

.container {
    background: transparent;
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    align-items: flex-start;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 1000px;
}

.nav-group h3 {
    color: #fff;
    font-size: 18px;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.nav-group-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    text-decoration: none;
    color: #fff;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.nav-item.drag-over {
    border: 2px dashed #fff;
    opacity: 0.7;
}

.nav-item.add-btn {
    background: rgba(74, 144, 226, 0.5);
}

.nav-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

.nav-item.add-btn img {
    width: 20px;
    height: 20px;
    object-fit: cover;
}

.nav-item span {
    font-size: 12px;
    text-align: center;
    word-break: break-word;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-item .delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #fff !important;
    border: 2px solid #e74c3c !important;
    border-radius: 50%;
    color: #e74c3c !important;
    font-size: 14px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.nav-item:hover .delete-btn {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item .edit-btn {
    position: absolute;
    bottom: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: #fff !important;
    border: 2px solid #4a90e2 !important;
    border-radius: 50%;
    color: #4a90e2 !important;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.nav-item:hover .edit-btn {
    opacity: 1;
    transform: scale(1.1);
}

.input-section {
    width: 100%;
    max-width: 700px;
    padding: 20px 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease-in-out;
}

.input-section.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.add-form, .wallpaper-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

input {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: #fff;
    caret-color: #fff;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

input[type="file"] {
    padding: 8px;
    color: #fff;
}

button {
    padding: 10px 20px;
    background: rgba(52, 152, 219, 0.8);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: rgba(41, 128, 185, 0.8);
}

.input-section button[onclick="refreshData()"] {
    background: rgba(255, 99, 71, 0.8);
}

.input-section button[onclick="refreshData()"]:hover {
    background: rgba(255, 69, 0, 0.8);
}

@media (max-width: 480px) {
    .nav-list { gap: 15px; }
    .nav-group { max-width: 100%; }
    .nav-group-list { gap: 10px; }
    .time-section #timeDisplay { font-size: 36px; }
    .time-section #dateDisplay { font-size: 14px; }
    .search-bar input { font-size: 14px; }
    .search-bar select { font-size: 12px; padding: 8px; }
    .search-bar button { font-size: 12px; }
    .nav-item img { width: 36px; height: 36px; }
    .nav-item.add-btn img { width: 20px; height: 20px; }
    .nav-item span { font-size: 10px; }
}