/* RainCity Contractor Connect - Homeowner System Styles */

/* Fix for WordPress Admin Bar - Hide it completely */
#wpadminbar {
    display: none !important;
}

body.admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

html {
    margin-top: 0 !important;
}

.rccc-homeowner-dashboard,
.rccc-contractor-dashboard {
    position: relative;
    z-index: 1;
}

.rccc-homeowner-registration {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.rccc-homeowner-dashboard,
.rccc-contractor-dashboard {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Registration Form */
.rccc-homeowner-registration form {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4,120,87,0.1);
}

.rccc-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.rccc-btn:hover {
    background: #1e293b;
}

.rccc-btn-primary {
    background: #047857;
}

.rccc-btn-primary:hover {
    background: #065f46;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

#rccc-reg-message {
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
}

#rccc-reg-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

#rccc-reg-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.dashboard-header h1 {
    margin: 0;
    color: #0f172a;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logout-link {
    display: none !important;
}

.dashboard-actions {
    margin-bottom: 30px;
}

/* Project Cards */
.project-card,
.contractor-project-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-header h3 {
    margin: 0;
    color: #0f172a;
}

.project-status,
.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.status-active,
.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-estimate,
.badge-estimate-pending {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-estimate-accepted {
    background: #d1fae5;
    color: #065f46;
}

.badge-invoice-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-invoice-unpaid {
    background: #fef3c7;
    color: #92400e;
}

.project-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.project-contractors,
.project-estimates,
.project-messages,
.project-invoices,
.project-uploads,
.project-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.project-contractors h4,
.project-estimates h4,
.project-messages h4,
.project-invoices h4,
.project-uploads h4,
.project-actions h4 {
    margin: 0 0 12px 0;
    color: #334155;
    font-size: 16px;
}

.contractors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.contractor-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}

.contractor-item.status-accepted {
    background: #d1fae5;
    border-color: #34d399;
}

.contractor-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.contractor-status {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.view-profile {
    display: inline-block;
    margin-top: 8px;
    color: #047857;
    text-decoration: none;
    font-size: 13px;
}

.view-profile:hover {
    text-decoration: underline;
}

.estimate-item,
.invoice-item,
.message-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f8fafc;
}

.estimate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-item {
    position: relative;
}

.message-from {
    font-weight: 600;
    margin-bottom: 4px;
    color: #0f172a;
}

.message-content {
    color: #475569;
    margin-bottom: 8px;
}

.message-date {
    font-size: 12px;
    color: #94a3b8;
}

.uploads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.upload-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.upload-item p {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #64748b;
}

/* Contractor Dashboard Specific */
.contractor-project-card.accepted {
    border-left: 4px solid #047857;
}

/* Archived projects have a gray border and subtle opacity */
.contractor-project-card[data-archived="1"] {
    border-left: 4px solid #9ca3af;
    opacity: 0.75;
    background: #f9fafb;
}

.contractor-project-card[data-archived="1"] .project-header h3 {
    color: #6b7280;
}

.contractor-project-card[data-archived="1"] .badge {
    opacity: 0.8;
}

.project-details {
    margin-bottom: 16px;
}

.project-details p {
    margin: 8px 0;
    color: #475569;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.estimate-summary {
    width: 100%;
    margin-bottom: 16px;
}

.estimate-summary h5 {
    margin: 0 0 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .project-meta {
        flex-direction: column;
        gap: 8px;
    }

    .contractors-grid {
        grid-template-columns: 1fr;
    }

    .project-actions {
        flex-direction: column;
    }

    .project-actions .rccc-btn {
        width: 100%;
    }
}

/* ========================================
   DASHBOARD SIDEBAR LAYOUT & FLOATING CONTACT
   ======================================== */

/* Floating Contact Button */
.rccc-floating-contact {
    position: fixed;
    bottom: 80px;
    left: 30px;
    background: #047857;
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 9998;
}

.rccc-floating-contact:hover {
    background: #065f46;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(4, 120, 87, 0.5);
}

.rccc-floating-contact svg {
    width: 20px;
    height: 20px;
}

.rccc-floating-contact span {
    color: #fff;
}

/* Dashboard Container with Sidebar */
.dashboard-container {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 30px !important;
    margin-top: 20px;
    width: 100%;
    clear: both;
    align-items: start !important;
}

.dashboard-main {
    min-width: 0; /* Prevents grid overflow */
    width: 100%;
}

/* Sidebar Styles */
.dashboard-sidebar {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Contact Widget */
.contact-widget {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: #fff;
    border: none;
}

.contact-widget h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #fff;
}

.contact-widget p {
    margin: 0 0 15px 0;
    font-size: 14px;
    opacity: 0.95;
}

.contact-widget .rccc-btn-secondary {
    background: #fff;
    color: #047857;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
}

.contact-widget .rccc-btn-secondary:hover {
    background: #f0fdf4;
}

.contact-info {
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 13px;
}

.contact-info p {
    margin: 8px 0;
}

.contact-info strong {
    font-weight: 700;
}

/* Ad Widget Styles */
.ad-widget {
    text-align: center;
}

.ad-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.ad-space {
    overflow: hidden;
    border-radius: 6px;
}

.ad-placeholder {
    display: block;
    text-decoration: none;
}

.ad-placeholder img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Text Ad Styling */
.ad-placeholder.text-ad {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    transition: transform 0.2s;
}

.ad-placeholder.text-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.ad-placeholder.text-ad h4 {
    margin: 0 0 10px 0;
    color: #0c4a6e;
    font-size: 16px;
}

.ad-placeholder.text-ad p {
    margin: 0 0 12px 0;
    color: #075985;
    font-size: 14px;
    line-height: 1.5;
}

.ad-cta {
    color: #0ea5e9;
    font-weight: 600;
    font-size: 14px;
}

/* Tips Widget */
.tips-widget h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1f2937;
}

.tips-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-widget li {
    margin-bottom: 10px;
}

.tips-widget a {
    color: #047857;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    display: block;
    padding: 8px;
    border-radius: 4px;
}

.tips-widget a:hover {
    color: #065f46;
    background: #f0fdf4;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        order: -1; /* Move sidebar above main content on mobile */
    }
    
    .rccc-floating-contact {
        bottom: 20px;
        left: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .rccc-floating-contact span {
        display: none; /* Hide text on mobile, show only icon */
    }
    
    .rccc-floating-contact svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        gap: 15px;
    }
    
    .sidebar-widget {
        padding: 15px;
    }
}

/* ========================================
   CONTRACTORS ARCHIVE PAGE
   ======================================== */

.rccc-contractors-archive {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.archive-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.archive-header h1 {
    margin: 0 0 10px 0;
    color: #0f172a;
    font-size: 32px;
}

.archive-description {
    margin: 0;
    color: #64748b;
    font-size: 16px;
}

/* Contractors Grid */
.contractors-grid-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.contractor-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, transform 0.2s;
}

.contractor-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.contractor-card-header {
    margin-bottom: 16px;
}

.contractor-card-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.contractor-card-header h3 a {
    color: #0f172a;
    text-decoration: none;
}

.contractor-card-header h3 a:hover {
    color: #047857;
}

.contractor-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.contractor-rating .stars {
    color: #fbbf24;
    font-size: 18px;
    letter-spacing: 2px;
}

.contractor-rating .rating-text {
    color: #64748b;
    font-size: 14px;
}

.contractor-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.category-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.contractor-contact {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.contractor-contact p {
    margin: 6px 0;
    font-size: 14px;
    color: #475569;
}

.contractor-contact strong {
    color: #334155;
}

.contractor-actions {
    display: flex;
    gap: 10px;
}

.no-contractors {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.pagination .page-numbers {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #047857;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    background: #f0fdf4;
    border-color: #047857;
}

.pagination .page-numbers.current {
    background: #047857;
    color: #fff;
    border-color: #047857;
}

/* Mobile Responsive for Archive */
@media (max-width: 1024px) {
    .contractors-grid-archive {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .archive-header h1 {
        font-size: 24px;
    }
    
    .contractor-card {
        padding: 16px;
    }
}

/* ========== Enhanced Estimate & Invoice UI ========== */

/* Estimate Item Styling */
.estimate-item,
.invoice-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.estimate-item:hover,
.invoice-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Status-specific styling */
.estimate-item.status-pending {
    border-left: 4px solid #f59e0b;
}

.estimate-item.status-accepted {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.estimate-item.status-rejected {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.invoice-item.status-unpaid {
    border-left: 4px solid #f59e0b;
}

.invoice-item.status-paid {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

/* Headers */
.estimate-header,
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.estimate-header strong,
.invoice-header strong {
    font-size: 16px;
    color: #0f172a;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estimate-status.status-badge,
.invoice-status.status-badge {
    color: #fff;
}

.status-badge:contains("Pending") {
    background: #f59e0b;
}

.status-badge:contains("Accepted") {
    background: #10b981;
}

.status-badge:contains("Rejected") {
    background: #ef4444;
}

.status-badge:contains("Unpaid") {
    background: #f59e0b;
}

.status-badge:contains("Paid") {
    background: #10b981;
}

/* Details Section */
.estimate-details,
.invoice-details {
    margin-bottom: 12px;
}

.estimate-amount,
.invoice-amount,
.invoice-due {
    margin: 8px 0;
    font-size: 14px;
    color: #475569;
}

.estimate-amount strong,
.invoice-amount strong,
.invoice-due strong {
    color: #0f172a;
    font-weight: 600;
}

.estimate-notes {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 14px;
    color: #475569;
}

.estimate-notes strong {
    color: #0f172a;
}

/* PDF View Button */
.btn-view-pdf {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-view-pdf:hover {
    background: #2563eb;
    color: #fff;
}

/* Action Buttons */
.estimate-actions,
.invoice-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.rccc-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.rccc-btn-primary {
    background: #047857;
    color: #fff;
}

.rccc-btn-primary:hover {
    background: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(4,120,87,0.3);
}

.rccc-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.rccc-btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.rccc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Message */
.estimate-accepted,
.invoice-paid {
    padding: 12px;
    background: #d1fae5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.success-message {
    color: #047857;
    font-weight: 600;
    font-size: 14px;
}

/* Modal Styling (for payment form) */
#rccc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#rccc-modal-overlay .modal-content {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

#rccc-modal-overlay h2 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #0f172a;
    font-size: 24px;
}

.rccc-form .form-group {
    margin-bottom: 20px;
}

.rccc-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}

.rccc-form input[type="text"],
.rccc-form input[type="date"],
.rccc-form input[type="number"],
.rccc-form select,
.rccc-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.rccc-form input:focus,
.rccc-form select:focus,
.rccc-form textarea:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4,120,87,0.1);
}

.rccc-form input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.rccc-form textarea {
    resize: vertical;
    min-height: 80px;
}

.alert-info {
    padding: 12px;
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    margin: 16px 0;
    border-radius: 4px;
    font-size: 14px;
    color: #1e40af;
}

.alert-info strong {
    color: #1e3a8a;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.form-actions .rccc-btn {
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
}

/* Responsive */
@media (max-width: 640px) {
    .estimate-actions,
    .invoice-actions {
        flex-direction: column;
    }
    
    .rccc-btn {
        width: 100%;
        text-align: center;
    }
    
    .estimate-header,
    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #rccc-modal-overlay .modal-content {
        padding: 24px;
        width: 95%;
    }
}

/* Messages & Communications */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    padding: 12px 16px;
    border-radius: 8px;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
}

.message-item.message-sent {
    background: #dbeafe;
    border-left-color: #3b82f6;
    margin-left: 20px;
}

.message-item.message-received {
    background: #f0fdf4;
    border-left-color: #22c55e;
    margin-right: 20px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-header strong {
    color: #1e293b;
    font-size: 14px;
}

.message-date {
    color: #64748b;
    font-size: 12px;
}

.message-content {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .message-item.message-sent {
        margin-left: 0;
    }
    
    .message-item.message-received {
        margin-right: 0;
    }
}
