@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #fe2c55;
    --secondary-color: #25f4ee;
    --dark-bg: #121212;
    --card-bg: #1e1e1e;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --success-color: #00c853;
    --warning-color: #ffab00;
    --danger-color: #ff5252;
}

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

body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background: var(--dark-bg);
    color: var(--text-color);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h2 i {
    font-size: 1.5rem;
}

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

.nav-menu li {
    margin: 5px 10px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    color: white;
}

.nav-menu a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-muted);
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--dark-bg);
    border-radius: 10px;
    margin-bottom: 15px;
}

.switch-container label {
    margin-bottom: 0;
    color: var(--text-color);
}

.switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(254, 44, 85, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #00e676);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 200, 83, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 82, 82, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ffc107);
    color: #000;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 171, 0, 0.4);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.85rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 15px;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card h4 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-muted);
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.alert-success {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    color: var(--text-muted);
    font-weight: 500;
    background: var(--dark-bg);
}

table tbody tr:hover {
    background: rgba(254, 44, 85, 0.05);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(0, 200, 83, 0.2);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(255, 171, 0, 0.2);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(255, 82, 82, 0.2);
    color: var(--danger-color);
}

.badge-info {
    background: rgba(37, 244, 238, 0.2);
    color: var(--secondary-color);
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    min-width: 200px;
}

.search-box select {
    min-width: 150px;
}

.device-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--danger-color);
}

.chart-container {
    background: var(--dark-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
}

.auto-refresh-indicator {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

@media (max-width: 992px) {
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 15px 0;
    }
    
    .sidebar-header {
        padding: 0 10px 15px;
    }
    
    .sidebar-header h2 span {
        display: none;
    }
    
    .nav-menu a span {
        display: none;
    }
    
    .nav-menu a {
        justify-content: center;
        padding: 15px;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
    
    .device-actions {
        flex-direction: column;
    }
}
