/* OneCloud Networks Support Portal - Stylesheet */

:root {
    --color-primary: #0a3d62;
    --color-accent: #2e86c1;
    --color-success: #17a589;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-light: #ecf0f1;
    --color-gray: #95a5a6;
    --color-dark: #2c3e50;
    --color-white: #ffffff;
    --color-border: #ddd;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --spacing-unit: 8px;
    --border-radius: 6px;
}

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-primary);
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: calc(var(--spacing-unit) * 1);
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    color: #555;
}

small {
    font-size: 12px;
    color: #999;
}

/* Navigation Bar */
.navbar {
    background-color: var(--color-primary);
    color: white;
    padding: calc(var(--spacing-unit) * 1.5) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
    gap: calc(var(--spacing-unit) * 3);
}

.navbar-brand {
    flex: 0 0 auto;
}

.logo-link {
    color: white;
    text-decoration: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 4px;
}

.logo-top {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    font-weight: 400;
    color: #fff;
}
.logo-top .cl {
    font-weight: 700;
    color: #6cb4ff;
}
.ai-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 6px;
    background: rgba(255,255,255,0.12);
    color: #5ddbab;
    border: 1px solid rgba(93,219,171,0.5);
    position: relative;
    animation: pulse-ai 2.5s ease-in-out infinite;
}
.ai-badge::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    border: 1px solid #2ecc71;
    opacity: 0;
    animation: glow-ring 2.5s ease-in-out infinite;
}
@keyframes pulse-ai {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.06); }
}
@keyframes glow-ring {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.08); }
}
.networks-sub {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    margin-left: 0;
    flex-basis: 100%;
    text-transform: uppercase;
}

/* .logo-sub removed */

.navbar-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.5);
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.2);
}

.user-role.role-admin {
    background-color: rgba(46, 134, 193, 0.3);
}

.user-role.role-customer {
    background-color: rgba(23, 165, 137, 0.3);
}

.btn-logout {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Main Layout */
.main-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px - 100px);
}

.sidebar {
    width: 250px;
    background-color: white;
    border-right: 1px solid var(--color-border);
    padding: calc(var(--spacing-unit) * 2) 0;
    flex-shrink: 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #f9f9f9;
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.menu-item.active {
    background-color: #f0f4f8;
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.menu-icon {
    font-size: 18px;
}

.menu-text {
    flex: 1;
}

.content-area {
    flex: 1;
    padding: calc(var(--spacing-unit) * 3);
    background-color: #f5f6fa;
    overflow-y: auto;
}

/* Page Header */
.page-header {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--color-border);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    margin: 0;
}

/* Alerts/Flash Messages */
.alert {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 14px;
    border-left: 4px solid transparent;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--color-danger);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--color-success);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--color-accent);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--color-warning);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Badges */
.badge-status-open {
    background-color: #d4edda;
    color: #155724;
}

.badge-status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-status-resolved {
    background-color: #e2e3e5;
    color: #383d41;
}

.badge-status-closed {
    background-color: #f8d7da;
    color: #721c24;
}

/* Priority Badges */
.badge-priority-low {
    background-color: #e2e3e5;
    color: #383d41;
}

.badge-priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.badge-priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-priority-default {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary);
}

.btn-secondary {
    background-color: #e9ecef;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background-color: #dee2e6;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.form-group label {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.1);
}

textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-card {
    background-color: white;
    padding: calc(var(--spacing-unit) * 3);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.form-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    margin-top: calc(var(--spacing-unit) * 3);
}

/* Tickets Table */
.tickets-table-wrapper {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.tickets-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--color-border);
}

.tickets-table th {
    padding: calc(var(--spacing-unit) * 1.5);
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
}

.tickets-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.3s;
}

.tickets-table tbody tr:hover {
    background-color: #f9f9f9;
}

.tickets-table td {
    padding: calc(var(--spacing-unit) * 1.5);
    font-size: 14px;
    vertical-align: middle;
}

.ticket-number {
    font-weight: 600;
    color: var(--color-primary);
}

.ticket-subject {
    font-weight: 500;
}

.ticket-date {
    color: #999;
    font-size: 13px;
}

/* Admin Controls */
.admin-controls {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
    flex-wrap: wrap;
}

.filter-btn {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
    background-color: #e9ecef;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.search-form {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
    flex: 1;
    min-width: 300px;
}

.search-input {
    flex: 1;
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.1);
}

/* Ticket Header */
.ticket-header {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ticket-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.ticket-info-col {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    font-weight: 600;
}

.info-item strong {
    color: #333;
    font-size: 16px;
}

.ticket-admin-actions {
    border-top: 1px solid var(--color-border);
    padding-top: calc(var(--spacing-unit) * 2);
}

/* Conversation Thread */
.conversation-thread {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.conversation-thread h2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.message {
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
}

.message-admin {
    background-color: #f0f4f8;
    border-left-color: var(--color-accent);
}

.message-customer {
    background-color: #f9f9f9;
    border-left-color: var(--color-success);
}

.message-header {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    margin-bottom: calc(var(--spacing-unit) * 1);
    flex-wrap: wrap;
}

.message-header strong {
    color: var(--color-primary);
}

.role-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.role-admin {
    background-color: #2e86c1;
    color: white;
}

.role-badge.role-customer {
    background-color: #17a589;
    color: white;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.message-body {
    color: #555;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Reply Form */
.reply-form-section {
    background-color: white;
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reply-form-section h2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Empty State */
.empty-state {
    background-color: white;
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    text-align: center;
    color: #999;
}

.empty-state p {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Footer */
.site-footer {
    background-color: white;
    border-top: 1px solid var(--color-border);
    padding: calc(var(--spacing-unit) * 2);
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: calc(var(--spacing-unit) * 3);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-link {
    color: var(--color-accent);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar { padding: 4px 0; }
  .navbar-container { gap: 8px; padding: 4px 12px; }
  .navbar-title { display: none; }
  .navbar-right { justify-content: flex-end; }
  .logo-top { font-size: 22px; }
  .networks-sub { font-size: 11px; letter-spacing: 2.5px; }
  .ai-badge { font-size: 10px; }
  .main-wrapper { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); padding: 0; }
  .sidebar-menu { flex-direction: row; overflow-x: auto; }
  .menu-item { white-space: nowrap; flex: 1; }
  .content-area { padding: 12px; }
  .page-header-content { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-header h1 { font-size: 24px; }
  .tickets-table { font-size: 12px; }
  .tickets-table th, .tickets-table td { padding: 8px; }
  .ticket-info-row { grid-template-columns: 1fr; }
  .admin-controls { flex-direction: column; align-items: flex-start; }
  .filters { width: 100%; }
  .search-form { width: 100%; flex-direction: column; }
  .search-input { width: 100%; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
}
@media (max-width: 480px) {
  .navbar { padding: 2px 0; }
  .navbar-container { padding: 2px 10px; gap: 6px; }
  .navbar-title { display: none; }
  .logo-top { font-size: 22px; }
  .networks-sub { font-size: 11px; }
  .ai-badge { font-size: 10px; padding: 2px 5px; }
  .user-info { display: none; }
  .btn { width: 100%; text-align: center; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { margin: 0; }
  .content-area { padding: 8px; }
  .page-header { padding: 12px 0; }
  .ticket-header { padding: 12px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  .message-header { flex-direction: column; align-items: flex-start; }
  .message-time { margin-left: 0; }
}
