/**
 * Orbiko Vault Holdings - Frontend Styles
 * Matches Orbiko brand design from orbiko.com/legal/audit-report
 * Version: 1.3.0
 */

.orbiko-vh-container {
    max-width: 1400px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.orbiko-vh-header {
    margin-bottom: 30px;
}

.orbiko-vh-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
}

.orbiko-vh-header p {
    color: #666;
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
}

.orbiko-vh-table-wrapper {
    overflow-x: auto;
    margin: 30px 0;
}

.orbiko-vh-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #333;
}

.orbiko-vh-table thead {
    background: #fff;
}

.orbiko-vh-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #ff9800;
    border: 2px solid #333;
    font-size: 0.95em;
}

.orbiko-vh-table th:first-child {
    text-align: center !important;
}

.orbiko-vh-table th:nth-child(4),
.orbiko-vh-table th:nth-child(5) {
    text-align: center !important;
}

.orbiko-vh-table td {
    padding: 15px;
    border: 2px solid #333;
    color: #333;
    background: #fff;
}

.orbiko-vh-table td:nth-child(2) {
    text-align: left !important;
}

.orbiko-vh-table td:nth-child(3),
.orbiko-vh-table td:nth-child(4) {
    text-align: center !important;
}

.orbiko-vh-table tbody tr {
    text-align: left;
}

.orbiko-vh-table tbody tr:hover {
    background: #fff8f0;
    transition: background 0.2s ease;
}

.orbiko-vh-number {
    text-align: center !important;
    font-variant-numeric: tabular-nums;
}

.orbiko-vh-table tfoot {
    background: #fff;
    font-weight: 600;
}

.orbiko-vh-table tfoot td {
    padding: 18px 15px;
    border: 2px solid #333;
    font-size: 1.1em;
}

.orbiko-vh-location {
    font-weight: 600;
    color: #ff9800;
    vertical-align: top;
    background: #fff8f0 !important;
    text-align: center !important;
}

.orbiko-vh-metal-subtotal {
    background: #f0f8ff !important;
    font-weight: 600;
}

.orbiko-vh-metal-subtotal:hover {
    background: #f0f8ff !important;
}

.orbiko-vh-metal-subtotal-label {
    text-align: left !important;
    color: #555;
    font-weight: 600;
    font-style: italic;
}

.orbiko-vh-metal-subtotal-value {
    color: #2196F3;
    font-weight: 600;
    text-align: center !important;
}

.orbiko-vh-subtotal {
    background: #f8f9fa !important;
    font-weight: 700;
}

.orbiko-vh-subtotal:hover {
    background: #f8f9fa !important;
}

.orbiko-vh-subtotal-label {
    text-align: left !important;
    color: #333;
    font-weight: 700;
}

.orbiko-vh-subtotal-value {
    color: #ff9800;
    font-weight: 700;
    text-align: center !important;
}

.orbiko-vh-timestamp {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.orbiko-vh-error,
.orbiko-vh-empty {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
}

.orbiko-vh-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Auto-Refresh Indicator */
.orbiko-vh-refresh-indicator {
    text-align: center;
    color: #666;
    font-size: 0.85em;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.orbiko-vh-refresh-icon {
    display: inline-block;
    font-size: 1.1em;
}

.orbiko-vh-spinning {
    animation: orbiko-vh-spin 1s linear infinite;
}

@keyframes orbiko-vh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.orbiko-vh-refreshing {
    background: #fff8f0;
    border-color: #ff9800;
    color: #ff9800;
}

.orbiko-vh-next-refresh {
    font-weight: 600;
    color: #ff9800;
}

/* Responsive Design */
@media (max-width: 768px) {
    .orbiko-vh-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .orbiko-vh-header h2 {
        font-size: 1.5em;
    }
    
    .orbiko-vh-table {
        font-size: 0.85em;
    }
    
    .orbiko-vh-table th,
    .orbiko-vh-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .orbiko-vh-container {
        padding: 15px;
    }
    
    .orbiko-vh-header h2 {
        font-size: 1.3em;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .orbiko-vh-table {
        font-size: 0.75em;
    }
    
    .orbiko-vh-table th,
    .orbiko-vh-table td {
        padding: 8px 5px;
    }
}

/* Force alignment overrides - v1.3.0 - Maximum specificity */
/* First product row in location (5 columns: Location, Product Name, Serial Number, Quantity, Weight) */
table.orbiko-vh-table tbody tr.orbiko-vh-first-row td:nth-child(1) {
    text-align: center !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-first-row td:nth-child(2) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-first-row td:nth-child(3) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-first-row td:nth-child(4) {
    text-align: center !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-first-row td:nth-child(5) {
    text-align: center !important;
}

/* Subsequent product rows (4 columns: Product Name, Serial Number, Quantity, Weight - Location uses rowspan) */
table.orbiko-vh-table tbody tr:not(.orbiko-vh-first-row):not(.orbiko-vh-metal-subtotal):not(.orbiko-vh-subtotal) td:nth-child(1) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr:not(.orbiko-vh-first-row):not(.orbiko-vh-metal-subtotal):not(.orbiko-vh-subtotal) td:nth-child(2) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr:not(.orbiko-vh-first-row):not(.orbiko-vh-metal-subtotal):not(.orbiko-vh-subtotal) td:nth-child(3) {
    text-align: center !important;
}

table.orbiko-vh-table tbody tr:not(.orbiko-vh-first-row):not(.orbiko-vh-metal-subtotal):not(.orbiko-vh-subtotal) td:nth-child(4) {
    text-align: center !important;
}

/* Subtotal rows (4 columns: Label, Empty, Quantity, Weight - no Location column) */
table.orbiko-vh-table tbody tr.orbiko-vh-metal-subtotal td:nth-child(1),
table.orbiko-vh-table tbody tr.orbiko-vh-subtotal td:nth-child(1) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-metal-subtotal td:nth-child(2),
table.orbiko-vh-table tbody tr.orbiko-vh-subtotal td:nth-child(2) {
    text-align: left !important;
}

table.orbiko-vh-table tbody tr.orbiko-vh-metal-subtotal td:nth-child(3),
table.orbiko-vh-table tbody tr.orbiko-vh-metal-subtotal td:nth-child(4),
table.orbiko-vh-table tbody tr.orbiko-vh-subtotal td:nth-child(3),
table.orbiko-vh-table tbody tr.orbiko-vh-subtotal td:nth-child(4) {
    text-align: center !important;
}
