/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1e90ff, #00ced1, #8a2be2 80%, #1e90ff);
    background-size: 200% 200%;
    animation: wave 15s ease infinite;
    color: #333;
    min-height: 100vh;
}

/* Wave animation */
@keyframes wave {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Login card */
.login-card {
    width: 100%;
    max-width: 350px;
    margin: 100px auto;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    color: #00b4cc;
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 0 0 5px rgba(0, 180, 204, 0.3);
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #e9ecef;
    color: #333;
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: box-shadow 0.3s;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    box-shadow: 0 0 8px rgba(0, 180, 204, 0.5);
}

.login-card button {
    padding: 10px 20px;
    background: #00b4cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.login-card button:hover {
    background: #009bb0;
    transform: scale(1.05);
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    gap: 5px;
}

/* Links card */
.links-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

/* Headings */
.links-card h1 {
    color: #00b4cc;
    font-size: 24px;
    text-shadow: 0 0 5px rgba(0, 180, 204, 0.3);
}

/* Form */
.link-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.link-form input[type="text"] {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #e9ecef;
    color: #333;
    font-size: 14px;
    width: 200px;
    outline: none;
    transition: box-shadow 0.3s;
}

.link-form input[type="text"]:focus {
    box-shadow: 0 0 8px rgba(0, 180, 204, 0.5);
}

/* Buttons */
.link-form button,
.delete-btn {
    padding: 10px 20px;
    background: #00b4cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.link-form button:hover,
.delete-btn:hover {
    background: #009bb0;
    transform: scale(1.05);
}

.save-btn {
    width: 40px;
    height: 40px;
    background: #28c76f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover {
    background: #24b363;
}

.delete-btn {
    width: 40px;
    height: 40px;
    background: #ea5455;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.delete-btn:hover {
    background: #d14b4c;
}

/* Messages */
#success-message,
#duplicate-message {
    display: none;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
}

#success-message {
    background: #28c76f;
    color: #fff;
}

#duplicate-message {
    background: #ea5455;
    color: #fff;
}

/* Link list */
.link-list {
    overflow: hidden;
}

#link-columns {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.link-column {
    list-style: none;
    width: 400px;
    min-height: 50px;
    transition: width 0.3s ease;
}

#link-list-1:empty,
#link-list-2:empty {
    width: 0;
    margin: 0;
}

#link-list-1:not(:empty) {
    width: 400px;
}

#link-list-2:not(:empty) {
    width: 400px;
}

.link-column li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #e9ecef;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: move;
}

.link-column li.dragging {
    opacity: 0.5;
}

.link-column li a {
    color: #00b4cc;
    text-decoration: none;
    font-size: 14px;
    flex: 1;
    text-align: left;
    margin-right: 10px;
}

.link-column li a:hover {
    color: #00d4e6;
}

/* Logout button */
.logout-btn {
    padding: 8px 15px;
    background: #ea5455;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s;
}

.logout-btn:hover {
    background: #d14b4c;
    transform: scale(1.05);
}

/* Access counter */
.access-counter {
    font-size: 12px;
    color: #666;
    text-align: right;
}

/* Responsive */
@media (max-width: 900px) {
    .links-card {
        max-width: 500px;
    }
    #link-columns {
        flex-direction: column;
        align-items: center;
    }
    .link-column {
        width: 100%;
    }
    #link-list-1:empty,
    #link-list-2:empty {
        width: 0;
    }
    #link-list-1:not(:empty),
    #link-list-2:not(:empty) {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .login-card,
    .links-card {
        margin: 20px auto;
        padding: 15px;
    }
    .link-form {
        flex-direction: column;
        gap: 8px;
    }
    .link-form input[type="text"] {
        width: 100%;
    }
    .save-btn {
        width: 100%;
    }
    .header {
        flex-direction: column;
        gap: 10px;
    }
    .header-right {
        align-items: center;
    }
}