/* Modern styles.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #1abc9c;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
}

header {
    background-color: var(--secondary-color);
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    margin-bottom: 2rem;
}

header h1 {
    color: white;
    font-size: 2rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.5px;
}

.nav-menu {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-menu li {
    margin-right: 1rem;
}

.nav-menu li a {
    display: block;
    color: var(--secondary-color);
    text-align: center;
    padding: 1rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background-color: transparent;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.printer-section {
    max-width: 1200px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

/* Full-width table container */
.printer-section.full-width {
    max-width: 100%;
    margin: 2rem 1rem;
}

.printer-section h1 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 1.8rem;
}

/* Table styling */
.printer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.printer-table thead {
    background-color: var(--secondary-color);
}

.printer-table th {
    text-align: left;
    padding: 1rem;
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.printer-table td {
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--medium-gray);
}

.printer-table tbody tr {
    transition: var(--transition);
}

.printer-table tbody tr:hover {
    background-color: var(--light-gray);
}

.printer-table tbody tr:last-child td {
    border-bottom: none;
}

/* Link styling for the details link */
.printer-table a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background-color: rgba(52, 152, 219, 0.1);
    transition: var(--transition);
    display: inline-block;
}

.printer-table a:hover {
    text-decoration: none;
    background-color: var(--primary-color);
    color: white;
}

/* For wide tables */
.printer-section {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

/* Log styling */
.log-container {
    background-color: #f8f9fa;
    border-radius: var(--radius);
    overflow: hidden; /* Use hidden on rounded containers to prevent corner artifacts */
    max-height: 70vh;
    border: 1px solid var(--medium-gray);
    margin: 1rem 0;
}

/* Inner scrollable wrapper for log containers */
.log-container > * {
    max-height: inherit;
    overflow: auto;
}

.log-container pre {
    color: var(--text-color);
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', monospace;
    padding: 1.5rem;
    /*white-space: pre-wrap;*/
    word-wrap: break-word;
}

button {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.data-container {
    width: 100%;
    max-width: 100%;
    margin: 1.5rem auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.data-container > div:first-child {
    flex: 1;
    min-width: 300px;
}

.data-container > div:first-child p {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--light-gray);
    border-radius: var(--radius);
    transition: var(--transition);
}

.data-container > div:first-child p:hover {
    background-color: var(--medium-gray);
}

.data-container strong {
    color: var(--secondary-color);
}

.ink-chart-container {
    flex: 1;
    min-width: 400px;
    min-height: 400px;
    padding: 1rem;
    border-radius: var(--radius);
    background-color: white;
    box-shadow: var(--shadow);
}

/* Additional modern elements */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--dark-gray);
}

.log-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.primary-button {
    background-color: var(--primary-color);
}

.secondary-button {
    background-color: var(--secondary-color);
}

.table-container {
    position: relative;
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
}

.full-width .printer-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

/* Animation for table rows */
.printer-table tbody tr {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading indicator */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse animation for hover states */
.data-container > div:first-child p:hover strong {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Transition for buttons */
button {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

button:active {
    transform: scale(0.96);
}

/* Heading styles */
.printer-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.printer-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .printer-section {
        margin: 1rem;
        padding: 1.5rem;
    }

    .data-container {
        flex-direction: column;
    }

    .ink-chart-container {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .nav-menu {
        padding: 0 1rem;
        flex-wrap: wrap;
    }

    .nav-menu ul {
        flex-direction: column;
        width: 100%;
    }

    .nav-menu li {
        margin-right: 0;
        width: 100%;
    }

    .nav-menu li a {
        text-align: left;
        padding: 0.75rem 1rem;
    }

    .printer-section {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 4px;
    }

    .printer-section h1 {
        font-size: 1.5rem;
    }

    .printer-section h2 {
        font-size: 1.2rem;
    }

    .data-container {
        flex-direction: column;
        gap: 1rem;
    }

    .data-container > div:first-child {
        min-width: 100%;
    }

    .ink-chart-container {
        min-width: 100%;
        min-height: 250px;
    }

    /* Table responsive styles */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .printer-table {
        font-size: 0.85rem;
    }

    .printer-table th,
    .printer-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* Button adjustments */
    button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        margin: 0.25rem 0;
    }

    /* Log container */
    .log-container {
        max-height: 50vh;
    }

    .log-container pre {
        font-size: 0.75rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }

    .printer-section {
        margin: 0.25rem;
        padding: 0.75rem;
    }

    .printer-section h1 {
        font-size: 1.3rem;
    }

    .printer-table {
        font-size: 0.75rem;
    }

    .printer-table th,
    .printer-table td {
        padding: 0.4rem 0.3rem;
    }

    .data-container > div:first-child p {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .chatbot-icon {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }
}

/* Chatbot Icon Styles */
.chatbot-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    transform-origin: center;
    animation: pulse 2s infinite;
}

.chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    animation: none;
}

.chatbot-icon-inner {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.chatbot-icon-inner span {
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    color: white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
}