/* Restaurant Weekly Audit - Frontend Styles */

.rwa-password-wrapper,
.rwa-form-wrapper,
.rwa-history-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rwa-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.rwa-card h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.rwa-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

/* Form Styles */
.rwa-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rwa-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rwa-row:has(.rwa-col-full) {
    grid-template-columns: 1fr;
}

.rwa-col {
    display: flex;
    flex-direction: column;
}

.rwa-col-full {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rwa-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rwa-field label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* Bilingual support styling */
.rwa-field label small {
    display: block;
    font-weight: 400;
    color: #666;
    font-size: 0.85em;
    margin-top: 3px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Urdu text styling */
.rwa-urdu-text {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
}

/* Button bilingual styling */
.rwa-btn small {
    display: block;
    margin-top: 3px;
    font-weight: normal;
    opacity: 0.9;
}

/* Placeholder bilingual styling */
.rwa-field input::placeholder,
.rwa-field textarea::placeholder {
    color: #999;
    font-style: italic;
}

.rwa-field input[type="number"],
.rwa-field input[type="password"],
.rwa-field input[type="date"],
.rwa-field textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.rwa-field input[type="number"]:focus,
.rwa-field input[type="password"]:focus,
.rwa-field input[type="date"]:focus,
.rwa-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.rwa-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button Styles */
.rwa-submit {
    margin-top: 20px;
}

.rwa-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.rwa-btn-primary {
    background: #0073aa;
    color: white;
}

.rwa-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.rwa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message Styles */
.rwa-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: 500;
}

.rwa-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rwa-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Notice Styles */
.rwa-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #0073aa;
}

.rwa-notice-info {
    background: #e7f3ff;
    color: #0c5460;
}

/* Table Styles */
.rwa-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.rwa-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.rwa-table th,
.rwa-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.rwa-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.rwa-table tr:hover {
    background: #f8f9fa;
}

.rwa-table td {
    color: #555;
}

/* Error Styles */
.rwa-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* Loading Styles */
.rwa-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: rwa-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .rwa-card {
        padding: 20px;
        margin: 10px;
    }
    
    .rwa-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .rwa-table-wrapper {
        font-size: 14px;
    }
    
    .rwa-table th,
    .rwa-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .rwa-password-wrapper,
    .rwa-form-wrapper,
    .rwa-history-wrapper {
        margin: 10px 0;
    }
    
    .rwa-card {
        padding: 15px;
        margin: 5px;
    }
    
    .rwa-card h3 {
        font-size: 20px;
    }
    
    .rwa-field input[type="number"],
    .rwa-field input[type="password"],
    .rwa-field input[type="date"],
    .rwa-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Print Styles */
@media print {
    .rwa-btn,
    .rwa-submit {
        display: none;
    }
    
    .rwa-card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .rwa-table {
        font-size: 12px;
    }
    
    .rwa-table th,
    .rwa-table td {
        padding: 6px;
        border: 1px solid #000;
    }
}

/* Bilingual table headers */
.rwa-history-table th small {
    display: block;
    font-weight: normal;
    color: #666;
    font-size: 0.75em;
    margin-top: 2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced analytics styling */
.rwa-analytics-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rwa-analytics-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.rwa-trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

.rwa-trend-up {
    color: #00a32a;
}

.rwa-trend-down {
    color: #d63638;
}

.rwa-trend-same {
    color: #666;
}

/* Labor reason fields styling */
#labor-extra-reason-field,
#labor-advance-reason-field {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    animation: fadeIn 0.3s ease-in;
}

#labor-extra-reason-field label,
#labor-advance-reason-field label {
    color: #007cba;
    font-weight: 600;
}

/* Wastage notes conditional styling */
#wastage-notes-row {
    animation: fadeIn 0.3s ease-in;
}

#wastage-notes-row .rwa-field {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

#wastage-notes-row label {
    color: #856404;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Frontend Summary Styles */
.rwa-summary-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.rwa-summary-container .rwa-title {
    text-align: center;
    color: #007cba;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

.rwa-summary-tabs .rwa-tab {
    color: #495057;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rwa-summary-tabs .rwa-tab:hover {
    background: #e9ecef;
    color: #007cba;
}

.rwa-summary-tabs .rwa-tab.active {
    color: #007cba;
    font-weight: bold;
}

.rwa-summary-tabs .rwa-tab-icon {
    font-size: 1.1em;
    margin-right: 8px;
}

.rwa-summary-tabs .rwa-tab-name {
    font-size: 1em;
}

/* 
 * Fix WordPress default styling conflicts
 * WordPress themes and admin styles often apply #0073aa blue borders
 * to links, form elements, and interactive components
 * These rules override those defaults with our plugin styling
 */
.rwa-summary-container * {
    border-color: #e9ecef !important;
}

.rwa-summary-container a {
    border-bottom: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.rwa-summary-container a:hover,
.rwa-summary-container a:focus,
.rwa-summary-container a:active {
    border-bottom: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.rwa-summary-container .rwa-tab {
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.rwa-summary-container .rwa-tab:hover,
.rwa-summary-container .rwa-tab:focus,
.rwa-summary-container .rwa-tab:active {
    border-bottom: none !important;
    box-shadow: none !important;
    outline: 2px solid rgba(0, 123, 186, 0.3) !important;
    outline-offset: 2px !important;
}

.rwa-summary-container .rwa-tab.active {
    border-bottom: 3px solid #007cba !important;
}

/* Fix WordPress form element conflicts */
.rwa-summary-container input,
.rwa-summary-container button,
.rwa-summary-container select,
.rwa-summary-container textarea {
    border-color: #ddd !important;
    box-shadow: none !important;
}

.rwa-summary-container input:focus,
.rwa-summary-container button:focus,
.rwa-summary-container select:focus,
.rwa-summary-container textarea:focus {
    border-color: #007cba !important;
    box-shadow: 0 0 0 1px rgba(0, 123, 186, 0.3) !important;
    outline: none !important;
}

/* Fix WordPress button conflicts */
.rwa-summary-container .rwa-btn,
.rwa-summary-container button {
    border: 1px solid #ddd !important;
    background: #f7f7f7 !important;
    color: #333 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

.rwa-summary-container .rwa-btn:hover,
.rwa-summary-container button:hover {
    background: #007cba !important;
    color: white !important;
    border-color: #005a87 !important;
}

/* Fix WordPress table conflicts */
.rwa-summary-container table,
.rwa-summary-container th,
.rwa-summary-container td {
    border-color: #e9ecef !important;
}

/* Fix WordPress card conflicts */
.rwa-summary-container .rwa-card,
.rwa-summary-container .rwa-admin-card {
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Apply similar fixes to daily entry form */
.rwa-container {
    border: none !important;
}

.rwa-container * {
    border-color: #e9ecef !important;
}

.rwa-container a {
    border-bottom: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.rwa-container a:hover,
.rwa-container a:focus,
.rwa-container a:active {
    border-bottom: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.rwa-container input,
.rwa-container button,
.rwa-container select,
.rwa-container textarea {
    border-color: #ddd !important;
    box-shadow: none !important;
}

.rwa-container input:focus,
.rwa-container button:focus,
.rwa-container select:focus,
.rwa-container textarea:focus {
    border-color: #007cba !important;
    box-shadow: 0 0 0 1px rgba(0, 123, 186, 0.3) !important;
    outline: none !important;
}

/* Global WordPress conflict prevention */
.rwa-container,
.rwa-summary-container {
    /* Remove any blue borders from WordPress defaults */
    --wp-admin-theme-color: #007cba !important;
    --wp-admin-border-color-darker-10: #007cba !important;
}

/* Specifically target elements that might get WordPress blue borders */
.rwa-container *[style*="#0073aa"],
.rwa-summary-container *[style*="#0073aa"],
.rwa-container *[style*="0073aa"],
.rwa-summary-container *[style*="0073aa"] {
    border-color: #e9ecef !important;
}

/* Override WordPress admin styles that might leak to frontend */
.rwa-container .wp-core-ui,
.rwa-summary-container .wp-core-ui,
.rwa-container .wp-admin,
.rwa-summary-container .wp-admin {
    border-color: #e9ecef !important;
}

/* Remove WordPress focus ring styles */
.rwa-container *:focus,
.rwa-summary-container *:focus {
    box-shadow: none !important;
    outline: 2px solid rgba(0, 123, 186, 0.3) !important;
    outline-offset: 1px !important;
}

/* Chart container styling fixes */
.rwa-chart-container {
    width: 100% !important;
    height: 400px !important;
    position: relative !important;
    margin: 20px 0 !important;
    background: white !important;
    border-radius: 8px !important;
    padding: 20px !important;
    border: 1px solid #e9ecef !important;
}

.rwa-chart-container canvas {
    width: 100% !important;
    height: 350px !important;
    max-width: none !important;
    max-height: none !important;
}

#weeklyChart,
#monthlyChart {
    display: block !important;
    width: 100% !important;
    height: 350px !important;
}

.rwa-loading {
    text-align: center !important;
    padding: 50px !important;
    color: #666 !important;
    font-size: 1.1em !important;
}

/* Date field specific styling */
.rwa-field input[type="date"] {
    cursor: pointer;
    position: relative;
}

.rwa-field input[type="date"]::-webkit-calendar-picker-indicator {
    color: #007cba;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
}

.rwa-field input[type="date"]:invalid {
    border-color: #dc3545;
}

.rwa-field input[type="date"]:valid {
    border-color: #28a745;
}

/* Responsive bilingual support */
@media (max-width: 768px) {
    .rwa-field label small {
        font-size: 0.8em;
        margin-top: 2px;
    }
    
    .rwa-btn small {
        font-size: 0.8em;
    }
    
    .rwa-history-table th small {
        font-size: 0.7em;
    }
    
    #labor-extra-reason-field,
    #labor-advance-reason-field {
        padding: 10px;
        margin-top: 8px;
    }
} 