/* Customer Portal Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f9fafb;
    color: #111827;
}

.hidden {
    display: none !important;
}

/* Header */
.portal-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    max-height: 50px;
    width: auto;
    height: auto;
}

.login-logo {
    max-width: 300px;
    max-height: 100px;
    width: auto;
    height: auto;
    margin-bottom: 1rem;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-link:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-count {
    background: var(--danger-color);
    color: white;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #6b7280;
    position: relative;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-weight: 500;
    color: #111827;
}

/* Main Content */
.portal-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

/* Footer */
.portal-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
}

.portal-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}


.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Device Grid */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.device-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.device-card h3 {
    margin-bottom: 0.5rem;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.device-status.online {
    color: var(--success-color);
}

.device-status.offline {
    color: #6b7280;
}

.device-info {
    color: #6b7280;
    font-size: 0.875rem;
}

.device-mac {
    font-family: monospace;
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Tickets */
.ticket-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn:hover {
    border-color: var(--primary-color);
}

.ticket-view {
    max-height: 600px;
    overflow-y: auto;
}

.ticket-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ticket-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ticket-description {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.ticket-replies {
    margin-bottom: 1.5rem;
}

.ticket-replies h4 {
    margin-bottom: 1rem;
}

.reply {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid #e5e7eb;
}

.reply.staff-reply {
    background: rgba(37, 99, 235, 0.05);
    border-left-color: var(--primary-color);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reply-time {
    color: #9ca3af;
    font-size: 0.875rem;
}

.ticket-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    resize: vertical;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge.success, .badge.status-resolved, .badge.status-closed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge.danger, .badge.status-open {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge.warning, .badge.status-in_progress, .badge.status-waiting_customer {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge.priority-urgent {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge.priority-high {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge.priority-medium {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.badge.priority-low {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    background: #f9fafb;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background: #f9fafb;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 1.5rem;
}

#modal.modal .modal-content {
    color-scheme: light;
    background: #ffffff;
    color: #111827;
}

#modal .modal-header,
#modal .modal-body {
    background: #ffffff;
    color: #111827;
}

#modal .modal-header h2,
#modal .form-group label,
#modal .modal-body label,
#modal .modal-body p,
#modal .modal-body li,
#modal .modal-body h2,
#modal .modal-body h3,
#modal .modal-body strong {
    color: #111827;
}

.modal-header h2,
.modal-body,
.modal-body p,
.modal-body li,
.modal-body label,
.modal-body h2,
.modal-body h3,
.modal-body strong {
    color: #111827;
}

.modal-body input,
.modal-body select,
.modal-body textarea,
.form-group input,
.form-group select,
.form-group textarea {
    background: #ffffff;
    color: #111827;
}

.modal-body input::placeholder,
.modal-body textarea::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #6b7280;
}

.modal-body select option {
    background: #ffffff;
    color: #111827;
}

.modal-body code {
    background: #f3f4f6;
    color: #111827;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
}

/* Device Detail Cards */
.devices-list {
    display: grid;
    gap: 1.5rem;
}

.device-detail-card {
    border: 2px solid #e5e7eb;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.device-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row label {
    font-weight: 500;
    color: #6b7280;
}

.account-details {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

