/* Frontend Styles for Quản lý Nail Plugin */

/* Container chính */
.nail-revenue-frontend {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tiêu đề */
.nail-title {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

/* Date picker */
.nail-date-picker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nail-date-picker label {
    font-weight: 600;
    margin-right: 15px;
    font-size: 16px;
}

.nail-date-picker input[type="date"] {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    margin: 0 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    min-width: 150px;
}

.nail-date-picker input[type="date"]:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Buttons */
.nail-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    margin: 0 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nail-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nail-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Current date display */
.nail-current-date {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.nail-current-date strong {
    color: #007cba;
    font-size: 18px;
}

/* Loading */
.nail-loading {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nail-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: nail-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Table container */
.nail-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 25px 0;
}

/* Bảng doanh thu */
.nail-revenue-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 14px;
}

.nail-revenue-table th,
.nail-revenue-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e1e5e9;
    vertical-align: middle;
}

/* Header */
.nail-revenue-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.staff-header {
    min-width: 120px;
    text-align: left !important;
}

/* Staff name column */
.staff-name {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-align: left !important;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #dee2e6;
}

/* Revenue cells */
.revenue-cell {
    position: relative;
    background: #fff;
    transition: background-color 0.2s ease;
}

.revenue-cell:hover {
    background: #f8f9fa;
}

/* Input fields */
.nail-revenue-input {
    width: 70px;
    padding: 8px 6px;
    border: 2px solid transparent;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: #495057;
    transition: all 0.3s ease;
}

.nail-revenue-input:focus {
    outline: none;
    border-color: #007cba;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    transform: scale(1.05);
}

.nail-revenue-input:hover {
    border-color: #6c757d;
    background: rgba(255, 255, 255, 0.8);
}

.nail-revenue-input[value]:not([value=""]) {
    background: #e8f4f8;
    color: #007cba;
    font-weight: 600;
}

/* Save indicator */
.nail-save-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    animation: nail-fade-in 0.3s ease;
}

/* Total columns */
.staff-total,
.customer-total,
.grand-total {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    font-weight: 700;
    font-size: 15px;
}

.total-row th {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick stats */
.nail-quick-stats {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.nail-stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.nail-stat-item:hover {
    transform: translateY(-5px);
}

.nail-stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.nail-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

/* Messages */
.nail-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    text-align: center;
    animation: nail-slide-down 0.3s ease;
}

.nail-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #b8dacc;
    color: #155724;
}

.nail-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f1b0b7;
    color: #721c24;
}

@keyframes nail-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nail-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Styles */
.nail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nail-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.nail-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: nail-popup-appear 0.3s ease-out;
}

@keyframes nail-popup-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.nail-popup-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.nail-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.nail-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.nail-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nail-popup-form {
    padding: 20px;
}

.nail-form-group {
    margin-bottom: 20px;
}

.nail-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.nail-form-group input,
.nail-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.nail-form-group input:focus,
.nail-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nail-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.nail-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.nail-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nail-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.nail-btn-secondary:hover {
    background: #5a6268;
}

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

.nail-btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Revenue cell styles */
.revenue-cell {
    position: relative;
    padding: 8px !important;
    text-align: center;
    vertical-align: middle;
}

.revenue-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.revenue-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

/* Revenue display styles */
.revenue-display {
    text-align: center;
    padding: 10px;
}

.revenue-amount {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.customer-count {
    color: #7f8c8d;
    font-size: 12px;
}

.revenue-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Detail popup styles */
.nail-popup-body {
    padding: 20px;
}

.nail-detail-info {
    margin-bottom: 20px;
}

.nail-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.nail-detail-row:last-child {
    border-bottom: none;
}

.nail-detail-label {
    font-weight: 600;
    color: #6c757d;
    flex: 0 0 40%;
}

.nail-detail-value {
    flex: 1;
    text-align: right;
    color: #333;
}

.nail-detail-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 18px;
}

/* Customer list styles */
.nail-customer-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 15px 0;
}

.nail-customer-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nail-customer-item:last-child {
    border-bottom: none;
}

.nail-customer-item:hover {
    background-color: #f8f9fa;
}

.nail-customer-info {
    flex: 1;
}

.nail-customer-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.nail-customer-details {
    font-size: 12px;
    color: #6c757d;
}

.nail-customer-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

.nail-customer-actions {
    display: flex;
    gap: 8px;
}

.nail-btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nail-btn-edit {
    background: #17a2b8;
    color: white;
}

.nail-btn-edit:hover {
    background: #138496;
}

.nail-btn-delete {
    background: #dc3545;
    color: white;
}

.nail-btn-delete:hover {
    background: #c82333;
}

/* Table structure updates */
.customer-name {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-align: left !important;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #dee2e6;
}

.customer-header {
    min-width: 120px;
    text-align: left !important;
}

.staff-header {
    min-width: 100px;
    text-align: center !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nail-revenue-frontend {
        margin: 10px 0;
    }

    .nail-title {
        font-size: 20px;
    }

    .nail-date-picker {
        padding: 15px;
        text-align: left;
    }

    .nail-date-picker label {
        display: block;
        margin-bottom: 10px;
    }

    .nail-date-picker input[type="date"] {
        width: 100%;
        margin: 5px 0;
    }

    .nail-button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }

    .nail-revenue-table {
        font-size: 12px;
        min-width: 500px;
    }

    .nail-revenue-table th,
    .nail-revenue-table td {
        padding: 8px 4px;
    }

    .nail-quick-stats {
        flex-direction: column;
        gap: 15px;
    }

    .nail-stat-item {
        min-width: auto;
        padding: 15px;
    }

    .nail-stat-value {
        font-size: 20px;
    }

    .nail-popup-content {
        width: 95%;
        margin: 10px;
    }

    .nail-popup-actions {
        flex-direction: column;
    }

    .nail-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .revenue-display {
        gap: 4px;
    }

    .revenue-amount {
        font-size: 14px;
    }

    .customer-count {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .nail-revenue-table {
        min-width: 400px;
    }

    .customer-header,
    .customer-name {
        min-width: 80px;
        font-size: 11px;
    }

    .staff-header {
        min-width: 70px;
        font-size: 11px;
    }

    .nail-stat-value {
        font-size: 18px;
    }

    .revenue-cell {
        padding: 4px !important;
    }

    .revenue-amount {
        font-size: 12px;
    }

    .nail-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .nail-detail-value {
        text-align: left;
    }
}
