/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0b0d19 0%, #111428 100%);
    --card-bg: rgba(22, 28, 45, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-glow-hover: rgba(0, 242, 254, 0.15);
    
    --primary: #00f2fe;
    --primary-hover: #4facfe;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    
    --secondary: #9d50bb;
    --secondary-gradient: linear-gradient(135deg, #9d50bb 0%, #6e48aa 100%);
    
    --text-main: #ffffff;
    --text-muted: #8e9bb2;
    --text-link: #00f2fe;
    
    --danger: #ff4b5c;
    --danger-gradient: linear-gradient(135deg, #ff4b5c 0%, #ff6b8b 100%);
    --warning: #fabe2c;
    --warning-gradient: linear-gradient(135deg, #fabe2c 0%, #f6d365 100%);
    --success: #00e676;
    --success-gradient: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-panel:hover {
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 12px 40px 0 var(--card-glow-hover);
}

/* Main Container Layout */
.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    padding: 2rem 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    background: rgba(22, 28, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0d19;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.user-info strong {
    color: var(--text-main);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: var(--secondary-gradient);
    color: #fff;
    box-shadow: 0 0 10px rgba(157, 80, 187, 0.3);
}

.badge-customer {
    background: var(--primary-gradient);
    color: #0b0d19;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Auth Cards (Login & Change Password) */
.auth-wrapper {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #b2c1d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(11, 13, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    background: rgba(11, 13, 25, 0.8);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #0b0d19;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 75, 92, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 75, 92, 0.5);
}

/* Alerts */
.alerts-container {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInDown 0.3s ease-out;
}

.alert-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(255, 75, 92, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(250, 190, 44, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* Dashboard UI Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    height: fit-content;
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-link:hover, .menu-link.active {
    background: rgba(0, 242, 254, 0.08);
    color: var(--primary);
    padding-left: 1.25rem;
}

/* Main Dashboard Panel */
.main-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panel-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards & Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

/* Devices Section */
.devices-card {
    padding: 1.75rem;
}

.section-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.device-card {
    padding: 1.25rem;
    background: rgba(11, 13, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.device-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.device-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
}

.device-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.device-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.device-meta span {
    color: var(--text-main);
    font-weight: 500;
}

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

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

/* Admin Dropdown Selector */
.admin-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-selector label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-selector select {
    background: #0b0d19;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.admin-selector select:focus {
    border-color: var(--primary);
}

/* Table styling for Admin view */
.custom-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.custom-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.action-link {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.action-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
