/* Device Manager Styles - Clean & Modern */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --danger: #f56565;
    --danger-dark: #e53e3e;
    --success: #48bb78;
    --warning: #ed8936;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-900: #1a202c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--gray-600);
    font-size: 16px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-state h2 {
    color: var(--danger);
    margin-bottom: 8px;
}

/* Quota Card */
.quota-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.quota-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.quota-info p {
    color: var(--gray-600);
    font-size: 14px;
}

.quota-visual {
    margin-top: 16px;
}

.quota-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
}

.quota-fill.warning {
    background: linear-gradient(90deg, var(--warning), #dd6b20);
}

.quota-fill.danger {
    background: linear-gradient(90deg, var(--danger), var(--danger-dark));
}

/* Actions Bar */
.actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Device Card */
.device-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.device-card:hover {
    box-shadow: var(--shadow-lg);
}

.device-card.current {
    border: 2px solid var(--primary);
    position: relative;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.device-name {
    flex: 1;
}

.device-name h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-current {
    background: var(--primary);
    color: white;
}

.badge-inactive {
    background: var(--gray-200);
    color: var(--gray-600);
}

.device-actions {
    display: flex;
    gap: 8px;
}

.device-info {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 4px;
}

.device-info strong {
    color: var(--gray-700);
}

.device-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-600);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    font-size: 24px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 14px;
    color: var(--gray-600);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal h2 {
    margin-bottom: 12px;
}

.modal p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .device-header {
        flex-direction: column;
    }

    .device-actions {
        width: 100%;
        margin-top: 12px;
    }

    .device-actions .btn {
        flex: 1;
    }

    .actions-bar {
        flex-direction: column;
    }

    .actions-bar .btn {
        width: 100%;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: unset;
    }
}

/* Footer */
.footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid var(--gray-200);
    text-align: center;
    color: var(--gray-600);
    font-size: 14px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p {
    margin: 8px 0;
}
