/* Base Reset & Variables */
:root {
    /* Light Mode Variables */
    --bg-color: #f0f4f8;
    --text-color: #333;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-text: #333;
    --primary-gradient: linear-gradient(135deg, #6e8efb, #a777e3);
    --hover-gradient: linear-gradient(135deg, #a777e3, #6e8efb);
    --danger-color: #ff4757;
    --table-header: rgba(255, 255, 255, 0.8);
    --table-row-hover: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --glass-bg: rgba(16, 18, 27, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-text: #fff;
    --primary-gradient: linear-gradient(135deg, #00f2fe, #4facfe);
    --hover-gradient: linear-gradient(135deg, #4facfe, #00f2fe);
    --table-header: rgba(16, 18, 27, 0.8);
    --table-row-hover: rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Blobs for Glassmorphism effect */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite alternate ease-in-out;
}

body::before {
    width: 300px;
    height: 300px;
    background: #6e8efb;
    top: -50px;
    left: -50px;
}

body::after {
    width: 400px;
    height: 400px;
    background: #a777e3;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

[data-theme="dark"] body::before {
    background: #00f2fe;
}
[data-theme="dark"] body::after {
    background: #e0c3fc;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* Glassmorphism Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 900px;
    width: 90%;
    transition: all 0.3s ease;
}

.login-container {
    max-width: 400px;
    margin-top: 10vh;
    text-align: center;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

input:focus {
    border-color: #6e8efb;
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.2), inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Checkbox Toggle */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.toggle-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Water Drop / Glass Button */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Water drop reflection effect */
.btn::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 10%;
    width: 80%;
    height: 30%;
    background: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0));
    border-radius: 50%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: var(--hover-gradient);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.btn-danger {
    background: var(--danger-color);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}
.btn-danger::after {
    background: linear-gradient(rgba(255,255,255,0.6), rgba(255,255,255,0));
}
.btn-danger:hover {
    background: #ff6b81;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: var(--table-header);
    font-weight: 600;
}

tr:hover {
    background: var(--table-row-hover);
}

/* Theme Toggle */
.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #6e8efb;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Helpers */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-center {
    text-align: center;
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
