/**
 * PCG Time Clock - Time Card Styles
 * 
 * Styles for both frontend technician view and admin payroll view
 * 
 * @since 5.3.1
 * @updated 5.3.2 - Removed portal header styles (now in pcg-tc-header.css)
 */

/* Container */
.pcg-tc-timecard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.pcg-tc-timecard-container h2 {
    margin-bottom: 20px;
    color: #23282d;
}

/* Form */
.pcg-tc-timecard-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.pcg-tc-timecard-form label {
    font-weight: 600;
    color: #333;
}

.pcg-tc-timecard-form input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.pcg-tc-period-info {
    color: #666;
    font-style: italic;
    margin-left: 10px;
}

/* Buttons */
.pcg-tc-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1a3a5c;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.pcg-tc-btn:hover,
.pcg-tc-btn:focus,
.pcg-tc-btn:visited {
    background: #2a5a8a;
    color: #fff !important;
}

.pcg-tc-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Quick Navigation */
.pcg-tc-quick-nav {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* Time Card Table */
.pcg-tc-timecard-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.pcg-tc-timecard-table th,
.pcg-tc-timecard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.pcg-tc-timecard-table thead th {
    background: #1a3a5c;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.pcg-tc-timecard-table thead th:nth-child(2) {
    text-align: left;
}

/* Day Rows */
.pcg-tc-day-row {
    cursor: pointer;
    transition: background 0.15s;
}

.pcg-tc-day-row:hover {
    background: #f5f9fc;
}

.pcg-tc-day-row.pcg-tc-weekend {
    background: #fafafa;
}

.pcg-tc-day-row.pcg-tc-weekend:hover {
    background: #f0f0f0;
}

/* Expand Button - Improved styling */
.pcg-tc-expand-cell {
    width: 40px;
    text-align: center;
}

.pcg-tc-expand-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid #1a3a5c;
    background: #fff;
    color: #1a3a5c;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 24px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pcg-tc-expand-btn:hover {
    background: #1a3a5c;
    color: #fff;
}

.pcg-tc-expand-btn.expanded {
    background: #1a3a5c;
    color: #fff;
    transform: rotate(45deg);
}

/* Detail Row */
.pcg-tc-detail-row {
    background: #f8f9fa;
}

.pcg-tc-detail-row > td {
    padding: 0 !important;
    border-bottom: 2px solid #1a3a5c;
}

.pcg-tc-detail-table {
    width: 100%;
    margin: 0;
    border: none;
    font-size: 13px;
    background: #fff;
}

.pcg-tc-detail-table th {
    background: #4a5a6a !important;
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.pcg-tc-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.pcg-tc-detail-table tr:last-child td {
    border-bottom: none;
}

.pcg-tc-detail-table tr:hover td {
    background: #f5f9fc;
}

/* Type Badges */
.pcg-tc-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcg-tc-type-onsite {
    background: #d4edda;
    color: #155724;
}

.pcg-tc-type-remote {
    background: #cce5ff;
    color: #004085;
}

.pcg-tc-type-ta {
    background: #fff3cd;
    color: #856404;
}

.pcg-tc-type-travel {
    background: #f8d7da;
    color: #721c24;
}

/* Totals Row */
.pcg-tc-totals-row {
    background: #e8f4f8 !important;
}

.pcg-tc-totals-row td {
    font-weight: 600;
    border-top: 2px solid #1a3a5c;
    color: #1a3a5c;
}

.pcg-tc-totals-decimal td {
    font-style: italic;
    color: #666;
    background: #f5f5f5;
    font-size: 13px;
}

/* Error Message */
.pcg-tc-error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 4px;
}

/* Admin Specific Styles */
.pcg-tc-admin-timecard .pcg-tc-timecard-table {
    margin-top: 15px;
}

/* Force white text on admin table headers (override WordPress widefat styles) */
.pcg-tc-admin-timecard .pcg-tc-timecard-table thead th,
.pcg-tc-admin-timecard .pcg-tc-timecard-table.widefat thead th,
.wrap.pcg-tc-admin-timecard table.pcg-tc-timecard-table thead th,
.wrap.pcg-tc-admin-timecard table.widefat thead th,
table.pcg-tc-timecard-table thead th {
    background: #1a3a5c !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.pcg-tc-admin-timecard .pcg-tc-detail-table thead th,
.pcg-tc-admin-timecard .pcg-tc-detail-table th,
.wrap.pcg-tc-admin-timecard .pcg-tc-detail-table th,
table.pcg-tc-detail-table thead th,
.pcg-tc-detail-table th {
    background: #4a5a6a !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* Make day cells more readable */
.pcg-tc-day-row td {
    color: #333;
}

.pcg-tc-day-row td:first-child {
    color: #1a3a5c;
}

/* Responsive */
@media (max-width: 768px) {
    .pcg-tc-timecard-form {
        flex-direction: column;
        align-items: stretch;
    }

    .pcg-tc-quick-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pcg-tc-timecard-table {
        font-size: 13px;
    }

    .pcg-tc-timecard-table th,
    .pcg-tc-timecard-table td {
        padding: 8px 6px;
    }

    .pcg-tc-detail-table {
        font-size: 12px;
    }
}
