/* GaragePro Frontend Styles */
/* Based on WordPress admin styling with modern garage management theme */

/* ====================
   ACCESS DENIED
   ==================== */
.access-denied {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.access-denied h2 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 28px;
}

.access-denied p {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.access-denied .btn {
    margin-top: 20px;
}

/* ====================
   MAIN LAYOUT
   ==================== */
.garagepro-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #f1f1f1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Break out of the WordPress theme's content-width constraint (theme: 999px).
       Using position+left instead of transform so position:fixed modals stay
       relative to the viewport, not this element. */
    width: 90vw !important;
    max-width: 90vw !important;
    position: relative;
    left: calc(50% - 45vw);
    box-sizing: border-box;
}

/* Header */
.garagepro-header {
    background: #2c3338;
    color: white;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.garagepro-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 0;
}

.garagepro-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.garagepro-title {
    margin: 0;
    color: white;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.garagepro-title .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.garagepro-version {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.garagepro-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #0073aa;
    object-fit: cover;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    background: #0073aa;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 2px;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: #dc3232;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background: #a00;
    color: white;
}

/* Main Container */
.garagepro-main-container {
    display: flex;
    flex: 1;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    gap: 20px;
    box-sizing: border-box;
}

/* Navigation */
.garagepro-nav {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.garagepro-nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.garagepro-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

h4 {
	color:var(--garagepro-text-light) !important;
	background-color:white !important;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: #2c3338;
    text-decoration: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #f8f9fa;
    border-left-color: #0073aa;
    color: #0073aa;
}

.nav-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
}

.garagepro-system-status {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.status-indicator .dashicons {
    color: #27ae60;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.status-text {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.current-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.current-time .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #0073aa;
}

/* Content Area */
.garagepro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* For proper text wrapping */
}

.garagepro-content-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.content-header-left h2 {
    margin: 0 0 8px 0;
    color: #2c3338;
    font-size: 22px;
    font-weight: 600;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.breadcrumb span {
    color: #666;
}

.breadcrumb .separator {
    color: #999;
}

.breadcrumb .current {
    color: #0073aa;
    font-weight: 500;
}

.content-header-right {
    display: flex;
    gap: 10px;
}

.garagepro-content-container {
    flex: 1;
}

/* ====================
   DASHBOARD SPECIFIC
   ==================== */
.dashboard-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #0073aa 0%, #00a0d2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.welcome-content h2 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.welcome-message {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    line-height: 1.5;
}

.welcome-actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid #0073aa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 2.5em;
    opacity: 0.8;
}

.stat-content h3 {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3338;
}

/* Dashboard Cards Layout */
.dashboard-cards {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.card:last-child {
    margin-bottom: 0;
}

.card-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3338;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-content {
    padding: 20px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action {
    text-align: left;
    padding: 12px 15px;
    border: 1px solid #ddd;
    background: white;
    color: #2c3338;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.btn-action:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
}

.btn-action .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Recent Jobs */
.recent-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto auto auto;
    gap: 15px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    align-items: center;
    transition: background-color 0.2s ease;
}

.job-item:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .job-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }
}

.job-number {
    font-weight: bold;
    color: #2c3338;
}

.job-customer, .job-vehicle, .job-amount, .job-date {
    color: #666;
    font-size: 14px;
}

.job-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    color: white;
    min-width: 80px;
}

.status-pending { background: #ffc107; color: #000; }
.status-sections_assigned,
.status-sections-assigned { background: #2196F3; color: #fff; }
.status-awaiting_admin_review,
.status-awaiting-admin-review { background: #FF5722; color: #fff; }
.status-approved { background: #4CAF50; color: #fff; }
.status-in_progress,
.status-in-progress { background: #FF9800; color: #fff; }
.status-quotation_sent,
.status-quotation-sent { background: #9C27B0; color: #fff; }
.status-completed { background: #4CAF50; color: #fff; }
.status-delivered { background: #4CAF50; color: #fff; }
.status-cancelled,
.status-rejected { background: #9E9E9E; color: #fff; }
.status-ready { background: #00BCD4; color: #000; }
.status-to_be_delivered,
.status-to-be-delivered { background: #00BCD4; color: #000; }

/* Vehicle list action buttons - keep plugin-consistent, theme-independent */
#vehicles-section .wp-list-table .col-actions {
    white-space: nowrap;
}

#vehicles-section .wp-list-table .col-actions .btn {
    margin-right: 6px;
    margin-bottom: 6px;
    min-width: 72px;
}

/* Customer list action buttons - keep plugin-consistent, theme-independent */
#customers-section .wp-list-table .col-actions {
    white-space: nowrap;
}

#customers-section .wp-list-table .col-actions .btn {
    margin-right: 6px;
    margin-bottom: 6px;
    min-width: 72px;
}

#customers-section .wp-list-table .col-actions .btn-view-customer {
    background: #0073aa;
    color: #fff;
}

#customers-section .wp-list-table .col-actions .btn-view-customer:hover {
    background: #005a87;
    color: #fff;
}

#customers-section .wp-list-table .col-actions .btn-edit-customer {
    background: #6c757d;
    color: #fff;
}

#customers-section .wp-list-table .col-actions .btn-edit-customer:hover {
    background: #545b62;
    color: #fff;
}

#customers-section .wp-list-table .col-actions .btn-delete-customer {
    background: #dc3545;
    color: #fff;
}

#customers-section .wp-list-table .col-actions .btn-delete-customer:hover {
    background: #c82333;
    color: #fff;
}
.btn-view-job {
    padding: 4px 12px;
    font-size: 12px;
}

/* ====================
   BUTTONS
   ==================== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: #0073aa;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ====================
   LOADING & ERROR STATES
   ==================== */
.loading-section {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-section {
    text-align: center;
    padding: 60px 20px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-section h3 {
    color: #c53030;
    margin-bottom: 15px;
    font-size: 20px;
}

.error-section p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 16px;
}

/* ====================
   MESSAGES
   ==================== */
.garagepro-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    max-width: 400px;
    font-size: 14px;
    font-weight: 500;
}

.garagepro-message.success {
    background: #38a169;
    border-left: 4px solid #2f855a;
}

.garagepro-message.error {
    background: #e53e3e;
    border-left: 4px solid #c53030;
}

.garagepro-message.info {
    background: #3182ce;
    border-left: 4px solid #2c5282;
}

.garagepro-message.warning {
    background: #d69e2e;
    border-left: 4px solid #b7791f;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====================
   NO DATA STATES
   ==================== */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 16px;
}

/* ====================
   FOOTER
   ==================== */
.garagepro-footer {
    background: #2c3338;
    color: #a7aaad;
    padding: 20px;
    margin-top: 30px;
    font-size: 13px;
}

.garagepro-footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left .copyright {
    margin: 0;
    font-size: 13px;
}

.system-info {
    display: flex;
    gap: 20px;
    font-size: 12px;
}

.memory-usage,
.server-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ====================
   LOADING OVERLAY
   ==================== */
.garagepro-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.loading-text {
    margin: 20px 0 0 0;
    color: #666;
    font-size: 16px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea,
select {
    width: 100%;
    margin: 0;
    padding: 10px 15px;
    border: 1px solid var(--wp--preset--color--border-color);
    outline: 0;
    resize: none;
    line-height: 20px;
    background: none;
    color: #2c3338;
    font-weight: 400;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* ====================
   RESPONSIVE DESIGN
   ==================== */
@media (max-width: 1200px) {
    .garagepro-main-container { /* already 100%, no override needed */
        flex-direction: column;
    }
    
    .garagepro-nav {
        width: 100%;
        order: 2;
    }
    
    .garagepro-nav-menu {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-left-color: transparent;
        border-bottom-color: #0073aa;
    }
}

@media (max-width: 768px) {
    .garagepro-header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .garagepro-user-info {
        flex-direction: column;
        align-items: center;
    }
    
    .user-details {
        align-items: center;
    }
    
    .garagepro-content-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .content-header-right {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-actions {
        width: 100%;
        justify-content: center;
    }
    
    .garagepro-footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .system-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .garagepro-nav-menu {
        grid-template-columns: 1fr;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .content-header-right {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====================
   PRINT STYLES
   ==================== */
@media print {
    .garagepro-header,
    .garagepro-nav,
    .garagepro-footer,
    .btn,
    .welcome-actions,
    .card-actions {
        display: none !important;
    }
    
    .garagepro-wrapper {
        background: white !important;
    }
    
    .garagepro-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .stat-card {
        break-inside: avoid;
    }
}