/* Die Shear Test - Shared Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    line-height: 1.5;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-box h1 {
    color: #059669;
    margin-bottom: 0.25rem;
}

.login-box p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

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

.nav-links a:hover {
    background: #f3f4f6;
}

.nav-links a.active {
    background: #10b981;
    color: white;
}

/* Main Content */
.main-container {
    min-height: 100vh;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    color: #1f2937;
    font-size: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    color: #374151;
}

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

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group small {
    color: #6b7280;
    font-size: 0.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Test Level Buttons */
.test-level-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.test-level-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.test-level-btn:hover {
    border-color: #10b981;
}

.test-level-btn.selected {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Fail Mode Buttons */
.fail-mode-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fail-mode-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.fail-mode-btn:hover {
    border-color: #10b981;
}

.fail-mode-btn.selected {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* LSL Display */
.lsl-display {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lsl-label {
    color: #059669;
    font-weight: 500;
}

.lsl-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #047857;
}

.lsl-unit {
    color: #6b7280;
}

/* Result Display */
.result-display {
    margin: 1rem 0;
    text-align: center;
}

.result-status {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1.5rem;
    font-weight: 700;
}

.result-pass {
    background: #d1fae5;
    color: #047857;
}

.result-fail {
    background: #fee2e2;
    color: #dc2626;
}

/* Status Badges */
.status-pass {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #d1fae5;
    color: #047857;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.status-fail {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #10b981;
    color: white;
}

.btn-primary:hover {
    background: #059669;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

tbody tr:hover {
    background: #f9fafb;
}

.no-data {
    text-align: center;
    color: #9ca3af;
    padding: 2rem !important;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Filters */
.filter-card {
    padding: 1rem 1.5rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-row .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Messages */
.error-msg {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-msg {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Info Note */
.info-note {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #047857;
}

/* LSL Preview in Modal */
.lsl-preview {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
}

.lsl-preview strong {
    width: 100%;
    color: #059669;
}

.lsl-preview span {
    color: #374151;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #10b981;
}

.tab-btn.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.stat-cpk {
    grid-column: span 1;
}

.stat-pass-rate {
    grid-column: span 1;
}

.cpk-good {
    color: #059669;
}

.cpk-ok {
    color: #d97706;
}

.cpk-bad {
    color: #dc2626;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    min-height: 350px;
}

.chart-card canvas {
    max-height: 300px;
}

@media (max-width: 640px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stat-cpk,
    .stat-pass-rate {
        grid-column: span 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row .form-group {
        width: 100%;
    }
}
