.modern-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.modern-modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modern-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    pointer-events: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modern-modal-overlay.active .modern-modal {
    transform: scale(1) translateY(0);
}

/* Modal body lock - prevents background scrolling when modal is open */
/* Note: position: fixed is only applied on mobile to prevent scrolling issues */
body.modal-open {
    overflow: hidden !important;
    /* Remove position: fixed for mobile compatibility */
    /* position: fixed !important; */
    /* width: 100% !important; */
    /* top: 0 !important; */
    /* left: 0 !important; */
}

/* Mobile-specific modal styles */
@media (max-width: 768px) {
    body.modal-open {
        position: fixed !important;
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
    }

    .modern-modal {
        max-height: 90vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        /* Ensure proper scrolling on iOS */
        overscroll-behavior: contain !important;
    }

    .modern-modal-overlay {
        /* Ensure overlay doesn't interfere with scrolling */
        overflow: hidden !important;
    }

    .modern-modal-overlay.active {
        /* Allow scrolling within modal on mobile */
        overflow: auto !important;
    }
}

.modern-modal-overlay:not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modern-modal-overlay:not(.active) * {
    pointer-events: none !important;
}

.modal-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    border-bottom: 2px solid #f7f7f7f7;
    background: linear-gradient(135deg, #292929 0%, #1a1a1a 100%);
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4c4b 0%, #e63946 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.modal-title-section h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.25rem 0;
}

.modal-title-section p {
    font-size: 14px;
    color: #cccccc;
    margin: 0;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #333333;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.modal-close-btn:hover {
    background: #ff4c4b;
    color: white;
    transform: scale(1.1);
}

.modal-content-modern {
    padding: 2rem;
}

.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #ff4c4b21;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: "DM Sans", sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 1.5rem;
}

.section-title i {
    color: #ff4c4b;
    font-size: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-weight: 600;
    font-size: 14px;
    color: #555555;
    letter-spacing: 0.025em;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777777;
    font-size: 14px;
    z-index: 2;
}

.modern-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #f7f7f7f7;
    border-radius: 8px;
    font-size: 14px;
    color: #333333;
    background: white;
    transition: all 0.2s ease;
    font-family: "Inter", sans-serif;
}

/* Date input specific styling for cross-platform compatibility */
.modern-input[type="date"] {
    /* Ensure calendar icon shows on all platforms */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    /* Remove default date picker styling */
    position: relative;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .modern-input[type="date"] {
        /* Force show calendar icon on iOS */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
        background-position: right 12px center !important;
        background-size: 16px !important;
        padding-right: 40px !important;
    }
}

/* Hide default date picker icon on webkit browsers */
.modern-input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    color: transparent;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

/* Firefox specific styling */
@-moz-document url-prefix() {
    .modern-input[type="date"] {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
}

.modern-input:focus {
    outline: none;
    border-color: #ff4c4b;
    box-shadow: 0 0 0 3px rgba(255, 76, 75, 0.1);
    transform: translateY(-1px);
}

.modern-input::placeholder {
    color: #a0aec0;
}

.modern-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f7f7f7f7;
    border-radius: 8px;
    font-size: 14px;
    color: #333333;
    background: white;
    transition: all 0.2s ease;
    font-family: "Inter", sans-serif;
    resize: vertical;
    min-height: 120px;
}

.modern-textarea:focus {
    outline: none;
    border-color: #ff4c4b;
    box-shadow: 0 0 0 3px rgba(255, 76, 75, 0.1);
    transform: translateY(-1px);
}

.modern-textarea::placeholder {
    color: #a0aec0;
}

.total-price-display {
    background: white;
    border: 2px solid #f7f7f7f7;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.total-price-display::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #ff4c4b 0%, #e63946 100%);
}

.total-price-display > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7f7f7f7;
}

.total-price-display > div:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #ff4c4b;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-radius: 8px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
}

.total-label {
    font-weight: 500;
    font-size: 14px;
    color: #555555;
}

.total-amount {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
}

.total-price-display > div:last-child .total-label {
    font-weight: 700;
    font-size: 18px;
    color: #ff4c4b;
}

.total-price-display > div:last-child .total-amount {
    font-size: 24px;
    font-weight: 800;
    color: #ff4c4b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f7f7f7f7;
}

.agreement-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agreement-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff4c4b;
    cursor: pointer;
}

.agreement-checkbox label {
    font-size: 14px;
    color: #555555;
    cursor: pointer;
    line-height: 1.5;
}

.submit-proposal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #ff4c4b 0%, #e63946 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-proposal-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.submit-proposal-btn:hover::before {
    left: 100%;
}

.submit-proposal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 76, 75, 0.3);
}

.submit-proposal-btn:active {
    transform: translateY(0);
}

.submit-proposal-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.submit-proposal-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.project-requirements-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid #f7f7f7f7;
    overflow: hidden;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.project-requirements-section:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #ff4c4b;
}

.requirements-title {
    font-family: "DM Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #292929 0%, #1a1a1a 100%);
    border-bottom: 2px solid #f7f7f7f7;
}

.requirements-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.requirement-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f7f7f7f7;
    border-radius: 8px;
    border-left: 4px solid #ff4c4b;
    transition: all 0.2s ease;
}

.requirement-item:hover {
    background: #f1f5f9;
    border-left-color: #e63946;
}

.requirement-icon {
    color: #ff4c4b;
    font-size: 18px;
    margin-top: 2px;
}

.requirement-text {
    flex: 1;
    font-size: 14px;
    color: #555555;
    line-height: 1.6;
}

.bid-history-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid #f7f7f7f7;
    overflow: hidden;
    margin: 1.5rem 0;
}

.bid-history-title {
    font-family: "DM Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #292929 0%, #1a1a1a 100%);
    border-bottom: 2px solid #f7f7f7f7;
}

.bid-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.bid-item:hover {
    background: #f7f7f7f7;
}

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

.bid-freelancer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bid-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bid-freelancer-name {
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.25rem;
}

.bid-amount {
    font-weight: 700;
    color: #ff4c4b;
    font-size: 1.125rem;
}

.bid-time {
    font-size: 12px;
    color: #777777;
}

.project-files-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid #f7f7f7f7;
    overflow: hidden;
    margin: 1.5rem 0;
}

.files-title {
    font-family: "DM Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #292929 0%, #1a1a1a 100%);
    border-bottom: 2px solid #f7f7f7f7;
}

.files-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: #f7f7f7f7;
    border-radius: 8px;
    border: 2px dashed #f7f7f7f7;
    transition: all 0.2s ease;
    text-align: center;
}

.file-item:hover {
    border-color: #ff4c4b;
    background: rgba(255, 76, 75, 0.05);
}

.file-icon {
    font-size: 32px;
}

.file-name {
    font-weight: 600;
    color: #333333;
    font-size: 14px;
}

.file-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ff4c4b 0%, #e63946 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.file-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 76, 75, 0.3);
    text-decoration: none;
    color: white;
}

.social-share-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f7f7f7f7;
    border-top: 1px solid #f7f7f7f7;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.share-btn.facebook {
    background: #3b5998;
}

.share-btn.twitter {
    background: linear-gradient(
        45deg,
        #f09433 0%,
        #e6683c 25%,
        #dc2743 50%,
        #cc2366 75%,
        #bc1888 100%
    );
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .modern-modal {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        /* Ensure proper mobile scrolling */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    .modal-header-modern {
        padding: 1.5rem;
    }

    .modal-content-modern {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .total-price-display {
        padding: 1rem;
        margin-top: 1rem;
    }

    .total-price-display > div:last-child {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .total-price-display > div:last-child .total-label {
        font-size: 16px;
    }

    .total-price-display > div:last-child .total-amount {
        font-size: 20px;
    }

    .form-actions {
        gap: 1.5rem;
    }

    .submit-proposal-btn {
        padding: 1rem;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-title-section h3 {
        font-size: 1.2rem;
    }
    .modal-header-modern {
        gap: 1rem;
    }

    .modal-close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .modern-input,
    .modern-textarea {
        padding: 10px 14px;
        font-size: 16px;
    }

    .modern-input {
        padding-left: 36px;
    }

    /* Mobile-specific date input styling */
    .modern-input[type="date"] {
        padding-right: 40px;
        background-position: right 8px center;
        background-size: 18px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.modern-modal::-webkit-scrollbar {
    width: 6px;
}

.modern-modal::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.modern-modal::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.modern-modal::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
