/* ============================================
   Estorax - Main Stylesheet
   Version: 1.0
   ============================================ */

/* ============================================
   1. Root Variables & Reset
   ============================================ */

:root {
    --primary-color: #1a3c6e;
    --primary-dark: #0f2847;
    --primary-light: #2a5298;
    --secondary-color: #f5a623;
    --secondary-dark: #e09515;
    --secondary-light: #fce4b8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #1a1a2e;
    --gray-text: #6c757d;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
    --shadow-md: 0 5px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 50px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --font-primary: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: #f0f2f5;
    color: var(--dark-text);
    line-height: 1.6;
    padding-top: 70px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   2. Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.3rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 0.95rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-text);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 15px;
    color: var(--dark-text);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-title.white {
    color: white;
}

.section-title.white::after {
    background: white;
}

.section-subtitle {
    color: var(--gray-text);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.text-primary-custom {
    color: var(--primary-color);
}

.text-secondary-custom {
    color: var(--secondary-color);
}

.text-success-custom {
    color: var(--success-color);
}

.text-danger-custom {
    color: var(--danger-color);
}

.text-gray {
    color: var(--gray-text);
}

.bg-primary-custom {
    background: var(--primary-color);
}

.bg-secondary-custom {
    background: var(--secondary-color);
}

.bg-light-custom {
    background: var(--light-bg);
}

/* ============================================
   3. Buttons
   ============================================ */

.btn {
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-text);
}

.btn-warning:hover {
    background: #e0a800;
    color: var(--dark-text);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-success {
    background: transparent;
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

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

/* ============================================
   4. Cards
   ============================================ */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: none;
    overflow: hidden;
    height: 100%;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-header i {
    margin-right: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--light-bg);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.card-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.card-text {
    color: var(--gray-text);
    font-size: 0.95rem;
}

.card-hover {
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   5. Forms
   ============================================ */

.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    transition: var(--transition);
    font-size: 0.95rem;
    background: white;
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.12);
    outline: none;
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.form-control::placeholder {
    color: #aaa;
}

.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-text);
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 3px;
}

.form-text {
    color: var(--gray-text);
    font-size: 0.85rem;
    margin-top: 4px;
}

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

.form-group .form-control {
    margin-top: 4px;
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   6. Contractor Cards
   ============================================ */

.contractor-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    height: 100%;
    text-align: center;
}

.contractor-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.contractor-card.premium {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #fff8f0 0%, white 100%);
}

.contractor-card .premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.contractor-card .verified-badge {
    color: var(--success-color);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.contractor-card .company-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    margin: 0 auto 15px;
    transition: var(--transition);
}

.contractor-card:hover .company-logo {
    border-color: var(--secondary-color);
}

.contractor-card .company-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.contractor-card .company-specialty {
    color: var(--gray-text);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.contractor-card .company-location {
    color: var(--gray-text);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.contractor-card .company-location i {
    color: var(--secondary-color);
    margin-right: 5px;
}

.contractor-card .rating {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.contractor-card .rating i {
    margin-right: 3px;
}

.contractor-card .rating .total-reviews {
    color: var(--gray-text);
    font-weight: 400;
    font-size: 0.85rem;
}

/* ============================================
   7. Project Cards
   ============================================ */

.project-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

.project-card.featured {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, #fffdf5 0%, white 100%);
}

.project-card .project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-text);
}

.project-card .project-title a {
    color: var(--dark-text);
}

.project-card .project-title a:hover {
    color: var(--primary-color);
}

.project-card .project-meta {
    font-size: 0.9rem;
    color: var(--gray-text);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.project-card .project-meta i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.project-card .project-budget {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1rem;
}

.project-card .project-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-status.open {
    background: #d4edda;
    color: #155724;
}
.project-status.assigned {
    background: #fff3cd;
    color: #856404;
}
.project-status.in_progress {
    background: #cce5ff;
    color: #004085;
}
.project-status.completed {
    background: #d1ecf1;
    color: #0c5460;
}
.project-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   8. Milestones
   ============================================ */

.milestone-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--gray-text);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.milestone-card:hover {
    box-shadow: var(--shadow-md);
}

.milestone-card.completed {
    border-left-color: var(--success-color);
}

.milestone-card.in_progress {
    border-left-color: var(--warning-color);
}

.milestone-card.pending {
    border-left-color: var(--gray-text);
}

.milestone-card .milestone-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.milestone-card .milestone-status {
    font-size: 0.85rem;
}

.milestone-card .milestone-status .badge {
    padding: 4px 10px;
}

/* ============================================
   9. Progress Bar
   ============================================ */

.progress-container {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 15px 0;
}

.progress-container h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.progress {
    height: 12px;
    background: #e9ecef;
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-color);
    transition: width 0.6s ease;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 12px;
    color: white;
    border-radius: 50px;
}

.progress-bar.bg-success {
    background: var(--success-color);
}

.progress-bar.bg-warning {
    background: var(--warning-color);
}

.progress-bar.bg-danger {
    background: var(--danger-color);
}

.progress-bar.bg-secondary {
    background: var(--secondary-color);
}

/* ============================================
   10. Star Rating
   ============================================ */

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 35px;
    color: #ddd;
    cursor: pointer;
    transition: var(--transition);
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--secondary-color);
}

.star-rating label i {
    transition: var(--transition);
}

.star-rating label:hover i {
    transform: scale(1.1);
}

.rating-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rating-display .stars {
    color: var(--secondary-color);
}

.rating-display .rating-number {
    font-weight: 600;
    color: var(--dark-text);
}

.rating-display .total {
    color: var(--gray-text);
    font-size: 0.85rem;
}

/* ============================================
   11. Notifications
   ============================================ */

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-item:hover {
    background: var(--light-bg);
}

.notification-item.unread {
    background: #e8f4fd;
    border-left: 3px solid var(--primary-color);
}

.notification-item .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item .notification-icon.bid {
    background: #e8f4fd;
    color: var(--primary-color);
}

.notification-item .notification-icon.success {
    background: #d4edda;
    color: var(--success-color);
}

.notification-item .notification-icon.warning {
    background: #fff3cd;
    color: var(--warning-color);
}

.notification-item .notification-icon.danger {
    background: #f8d7da;
    color: var(--danger-color);
}

.notification-item .notification-content {
    flex: 1;
}

.notification-item .notification-content .message {
    margin-bottom: 4px;
}

.notification-item .notification-content .time {
    font-size: 0.75rem;
    color: var(--gray-text);
}

/* ============================================
   12. Dashboard Cards
   ============================================ */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--gray-text);
    font-size: 0.95rem;
}

/* ============================================
   13. Hero Section
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 80px 0;
    color: white;
    margin-top: -70px;
    border-radius: 0 0 30px 30px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(245, 166, 35, 0.1);
    border-radius: 50%;
}

.hero-section h1 {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section h1 span {
    color: var(--secondary-color);
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 600px;
}

.hero-section .search-box {
    max-width: 500px;
    position: relative;
}

.hero-section .search-box input {
    padding: 15px 20px;
    border-radius: 50px;
    border: none;
    width: 100%;
    font-size: 1rem;
}

.hero-section .search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    border: none;
    border-radius: 50px;
    padding: 0 25px;
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
}

.hero-section .search-box button:hover {
    background: var(--secondary-dark);
}

/* ============================================
   14. Social Media
   ============================================ */

.social-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--primary-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-icons a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* ============================================
   15. Testimonials
   ============================================ */

.testimonial-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-md);
}

.testimonial-card .avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
    margin: 0 auto 15px;
}

.testimonial-card .quote {
    font-style: italic;
    color: var(--gray-text);
    font-size: 0.95rem;
}

.testimonial-card .author {
    font-weight: 600;
    margin-top: 10px;
}

/* ============================================
   16. Alerts
   ============================================ */

.alert-flash {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.5s ease;
    box-shadow: var(--shadow-lg);
    border: none;
    border-radius: var(--border-radius);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   17. Utility Classes
   ============================================ */

.text-primary-custom {
    color: var(--primary-color);
}

.text-secondary-custom {
    color: var(--secondary-color);
}

.bg-primary-custom {
    background: var(--primary-color);
}

.bg-secondary-custom {
    background: var(--secondary-color);
}

.rounded-custom {
    border-radius: var(--border-radius);
}

.shadow-custom {
    box-shadow: var(--shadow-sm);
}

.shadow-custom-hover:hover {
    box-shadow: var(--shadow-md);
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 16px;
}

.gap-4 {
    gap: 24px;
}

/* ============================================
   18. Responsive Adjustments
   ============================================ */

@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .hero-section {
        padding: 50px 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin: 0 auto 20px;
    }
    
    .hero-section .search-box {
        max-width: 100%;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 40px 0;
        border-radius: 0 0 20px 20px;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .contractor-card .company-logo {
        width: 60px;
        height: 60px;
    }
}

/* Navbar - Fix wrapping */
.navbar-nav {
    flex-wrap: nowrap;
}

.navbar-nav .nav-link {
    white-space: nowrap;
    padding: 8px 12px !important;
    font-size: 0.9rem;
}

/* For smaller screens, allow wrapping */
@media (max-width: 992px) {
    .navbar-nav {
        flex-wrap: wrap;
    }
    .navbar-nav .nav-link {
        white-space: normal;
        font-size: 0.85rem;
        padding: 6px 10px !important;
    }
}

/* Hide search box on smaller screens if needed */
@media (max-width: 768px) {
    .search-box.d-none.d-lg-block {
        display: none !important;
    }
}