/* Modern AssistX UI - Glassmorphism & Gradient Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-dark: #2d3748;
    --text-light: #ffffff;
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-hover: 0 12px 40px rgba(31, 38, 135, 0.5);
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>')
        no-repeat bottom;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.navbar-brand h1 {
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    margin: 0;
    animation: fadeInDown 0.6s ease-out;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-border);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-link.logout-btn {
    background: var(--danger-gradient);
    color: var(--text-light);
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(250, 112, 154, 0.3);
}

.nav-link.logout-btn:hover {
    box-shadow: 0 6px 15px rgba(250, 112, 154, 0.5);
    transform: translateY(-2px);
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    font-weight: 300;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Login Section - Glassmorphism */
.login-section {
    max-width: 440px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.login-section h2 {
    font-size: 2em;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-section input {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.login-section input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-section input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-section button,
.nav-button {
    width: 100%;
    padding: 16px 20px;
    margin: 15px 0 5px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 15px;
    color: var(--text-light);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    display: block;
    text-align: center;
}

.login-section button:hover,
.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.login-section button:active,
.nav-button:active {
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* Error & Info Messages */
.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    margin-top: 15px;
    font-size: 0.95em;
    border: 1px solid rgba(255, 107, 107, 0.3);
    animation: shake 0.3s ease;
}

.info-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-top: 15px;
    font-style: italic;
}

.success-message {
    color: #51cf66;
    background: rgba(81, 207, 102, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 0.95em;
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.message {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Container - Dashboard */
.container {
    max-width: 1000px;
    width: 100%;
    margin: 30px auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.container h1 {
    padding: 30px;
    text-align: center;
    color: var(--text-light);
    font-size: 2.2em;
    background: var(--primary-gradient);
    margin: 0;
}

.container h2 {
    color: var(--text-light);
    font-size: 1.8em;
    margin-bottom: 25px;
}

/* Form Section */
.form-section {
    padding: 35px;
    background: rgba(255, 255, 255, 0.05);
}

.form-section textarea {
    width: 100%;
    padding: 16px;
    font-size: 1em;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    resize: vertical;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.form-section textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-section textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.form-section select,
.form-section button {
    margin-top: 15px;
    padding: 14px 20px;
    font-size: 1em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.form-section select {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
}

.form-section select option {
    background: #764ba2;
    color: white;
}

.form-section button {
    width: 100%;
    background: var(--success-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.form-section button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
}

/* History Section */
.history {
    padding: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid var(--glass-border);
}

.history h3 {
    color: var(--text-light);
    font-size: 1.5em;
    margin-bottom: 20px;
}

.history-list {
    list-style: none;
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.history-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin: 12px 0;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
    max-height: 150px;
    overflow: hidden;
}

.history-list li:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.history-list li span {
    flex: 1;
    color: var(--text-light);
    word-break: break-word;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 15px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Buttons */
.copy-btn,
.delete-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn {
    background: var(--success-gradient);
    color: var(--text-light);
    margin-right: 8px;
    box-shadow: 0 3px 10px rgba(79, 172, 254, 0.3);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 172, 254, 0.5);
}

.delete-btn {
    background: var(--danger-gradient);
    color: var(--text-light);
    box-shadow: 0 3px 10px rgba(250, 112, 154, 0.3);
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(250, 112, 154, 0.5);
}

.clear-btn {
    background: var(--danger-gradient);
    color: var(--text-light);
    border: none;
    padding: 14px 25px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.6);
}

/* Footer */
footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 -8px 32px rgba(31, 38, 135, 0.2);
    position: relative;
    z-index: 10;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text-light);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.footer-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    margin: 0;
}

/* Admin Dashboard */
.add-user-form {
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.add-user-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 1.5em;
}

.add-user-form form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.add-user-form input,
.add-user-form select {
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-size: 0.95em;
}

.add-user-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.add-user-form select option {
    background: #764ba2;
    color: white;
}

.add-user-form button {
    padding: 12px 25px;
    background: var(--success-gradient);
    color: var(--text-light);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(79, 172, 254, 0.3);
}

.add-user-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 172, 254, 0.5);
}

/* Table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

th,
td {
    padding: 15px;
    text-align: left;
    color: var(--text-light);
}

th {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

th:first-child {
    border-radius: 12px 0 0 12px;
}

th:last-child {
    border-radius: 0 12px 12px 0;
}

tr {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.01);
}

td:first-child {
    border-radius: 12px 0 0 12px;
}

td:last-child {
    border-radius: 0 12px 12px 0;
}

.update-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.update-form input {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-size: 0.85em;
}

.update-form button {
    padding: 8px 16px;
    background: var(--success-gradient);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.update-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-brand h1 {
        font-size: 1.8em;
    }

    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .nav-link {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .login-section {
        padding: 40px 30px;
        margin: 20px;
    }

    .container {
        margin: 20px;
    }

    .form-section,
    .history {
        padding: 25px;
    }

    .add-user-form form {
        grid-template-columns: 1fr;
    }

    .footer-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .footer-btn {
        width: 100%;
    }

    table {
        font-size: 0.85em;
    }

    th,
    td {
        padding: 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
