/**
 * Illicoweb Support Portal - Main Styles
 */

/* Reset and Base Styles */
.illicoweb-support-portal * {
    box-sizing: border-box;
}

.illicoweb-support-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.illicoweb-support-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.illicoweb-support-header {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo img {
    max-height: 40px;
    width: auto;
}

.logo h1 {
    margin: 0;
    color: #0073aa;
    font-size: 1.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    color: #666;
    font-size: 0.9rem;
}

.support-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #0073aa;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f0f6fc;
    color: #005a87;
}

.nav-link.btn-primary {
    background-color: #0073aa;
    color: white;
}

.nav-link.btn-primary:hover {
    background-color: #005a87;
    color: white;
}

.nav-link.logout {
    color: #d63638;
}

.nav-link.logout:hover {
    background-color: #fcf0f1;
    color: #b32d2e;
}

/* Main Content */
.illicoweb-support-main {
    flex: 1;
    padding: 2rem 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
}

.btn-warning {
    background-color: #f0ad4e;
    color: white;
    border-color: #f0ad4e;
}

.btn-warning:hover {
    background-color: #ec971f;
    border-color: #d58512;
    color: white;
}

.btn-link {
    background: none;
    color: #0073aa;
    border: none;
    text-decoration: underline;
}

.btn-link:hover {
    color: #005a87;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: #0073aa;
    margin-bottom: 0.5rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #0073aa;
}

.stat-card.urgent {
    border-left-color: #d63638;
}

.stat-card.waiting {
    border-left-color: #f0ad4e;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #0073aa;
    display: block;
}

.stat-card.urgent .stat-number {
    color: #d63638;
}

.stat-card.waiting .stat-number {
    color: #f0ad4e;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Alerts */
.dashboard-alerts {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Filters */
.dashboard-filters {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Tickets */
.dashboard-tickets {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    background-color: #f8f9fa;
}

.tickets-header h2 {
    margin: 0;
    color: #333;
}

.tickets-count {
    color: #666;
    font-size: 0.9rem;
}

.no-tickets {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-tickets-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-tickets h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

/* Table Styles */
.support-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.support-table th,
.support-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.support-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.support-table tr:hover {
    background-color: #f8f9fa;
}

.ticket-row.urgent {
    border-left: 4px solid #d63638;
}

.ticket-info {
    min-width: 250px;
}

.ticket-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.ticket-title a {
    color: #0073aa;
    text-decoration: none;
}

.ticket-title a:hover {
    text-decoration: underline;
}

.ticket-date {
    font-size: 0.8rem;
    color: #666;
}

.escalation-badge {
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

/* Status and Urgency Badges */
.status-badge,
.urgency-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 12px;
    white-space: nowrap;
}

.status-badge.status-new {
    background-color: #e9ecef;
    color: #495057;
}

.status-badge.status-progress {
    background-color: #cce5ff;
    color: #0056b3;
}

.status-badge.status-waiting {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.status-resolved {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-closed {
    background-color: #f8f9fa;
    color: #6c757d;
}

.urgency-badge.urgency-blocking {
    background-color: #f8d7da;
    color: #721c24;
}

.urgency-badge.urgency-normal {
    background-color: #fff3cd;
    color: #856404;
}

.urgency-badge.urgency-enhancement {
    background-color: #e2e3ff;
    color: #383d41;
}

/* Ticket View Styles */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.separator {
    margin: 0 0.5rem;
    color: #666;
}

.ticket-header {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.ticket-title-section {
    flex: 1;
}

.ticket-title {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.5rem;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.meta-item {
    font-size: 0.9rem;
}

.meta-item strong {
    color: #333;
    margin-right: 0.5rem;
}

.ticket-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* Timeline */
.ticket-timeline {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e1e5e9;
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background-color: #0073aa;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #0073aa;
}

.timeline-item.escalation .timeline-marker {
    background-color: #f0ad4e;
    box-shadow: 0 0 0 2px #f0ad4e;
}

.timeline-date {
    font-size: 0.8rem;
    color: #666;
}

.timeline-event {
    font-weight: 500;
    color: #333;
}

/* Messages */
.ticket-messages {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.ticket-messages h3 {
    padding: 1rem;
    margin: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.messages-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e1e5e9;
}

.message-support {
    background-color: #f0f6fc;
    border-left-color: #0073aa;
}

.message-client {
    background-color: #f8f9fa;
    border-left-color: #6c757d;
}

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

.author-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.author-badge.support {
    background-color: #0073aa;
    color: white;
}

.author-badge.client {
    background-color: #6c757d;
    color: white;
}

.message-date {
    font-size: 0.8rem;
    color: #666;
}

.message-content {
    line-height: 1.6;
    color: #333;
}

.message-attachment {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

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

.attachment-size {
    font-size: 0.8rem;
    color: #666;
}

/* Forms */
.add-message-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-group.required label::after {
    content: ' *';
    color: #d63638;
}

.form-help {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
.illicoweb-support-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .support-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .ticket-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ticket-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .support-table {
        font-size: 0.8rem;
    }
    
    .support-table th,
    .support-table td {
        padding: 0.5rem;
    }
    
    .ticket-info {
        min-width: auto;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #666; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
