/* Create Farm Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #374151;
    background: linear-gradient(90deg, #1f2937, #111827);
}

.modal-header h2 {
    color: #4ade80;
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(31, 41, 55, 0.3);
    position: relative;
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #374151;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 120px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #374151;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #4ade80;
    color: #1f2937;
}

.step.active .step-label {
    color: #4ade80;
    font-weight: 600;
}

.step.completed .step-number {
    background: #10b981;
    color: white;
}

.step.completed .step-label {
    color: #10b981;
}

/* Modal Content */
.modal-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-header h3 {
    color: #e6e6e6;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #e6e6e6;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #e6e6e6;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.form-group small {
    display: block;
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Reward Preview */
.reward-preview {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.reward-preview h4 {
    color: #4ade80;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #e6e6e6;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-item span:last-child {
    font-weight: 600;
    color: #4ade80;
}

/* Review Section */
.review-section {
    display: grid;
    gap: 1.5rem;
}

.review-card {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #374151;
}

.review-card h4 {
    color: #4ade80;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #e6e6e6;
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-item span:first-child {
    color: #9ca3af;
}

.review-item span:last-child {
    font-weight: 600;
    color: #e6e6e6;
}

/* Cost Breakdown */
.cost-breakdown {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.cost-breakdown h4 {
    color: #fca5a5;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #e6e6e6;
}

.cost-item:last-child {
    margin-bottom: 0;
}

.cost-item.total {
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.cost-item span:last-child {
    color: #fca5a5;
    font-weight: 600;
}

/* Approval Info */
.approval-info {
    display: flex;
    gap: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.info-icon {
    color: #60a5fa;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-content h5 {
    color: #60a5fa;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-content p {
    color: #e6e6e6;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.info-content ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.info-content li {
    color: #d1d5db;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.info-content li::before {
    content: "•";
    color: #60a5fa;
    position: absolute;
    left: 0;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid #374151;
    background: rgba(31, 41, 55, 0.3);
    flex-shrink: 0;
    min-height: 80px;
    position: relative;
    z-index: 5;
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
    min-width: 100px;
    white-space: nowrap;
}

.btn-secondary {
    background: #374151;
    color: #e6e6e6;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4ade80;
    color: #1f2937;
}

.btn-primary:hover {
    background: #22c55e;
}

/* Button Focus States */
.btn:focus {
    outline: 2px solid rgba(74, 222, 128, 0.5);
    outline-offset: 2px;
}

.btn-success:focus {
    outline: 2px solid rgba(16, 185, 129, 0.5);
}

/* Ensure text visibility */
.btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
    border: 2px solid #059669 !important;
    position: relative !important;
    z-index: 10 !important;
    opacity: 1 !important;
}

.btn-success:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #047857 !important;
    opacity: 1 !important;
}

.btn-success:active {
    background: #047857 !important;
    color: #ffffff !important;
    transform: translateY(1px) !important;
}

/* Ensure no pseudo-elements interfere */
.btn-success::before,
.btn-success::after {
    display: none !important;
}

/* Additional text visibility fixes */
.btn-success * {
    color: #ffffff !important;
    opacity: 1 !important;
    z-index: 11 !important;
}

.modal-footer .btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
    letter-spacing: 0.5px !important;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Force text visibility on success button */
#create-farm-final {
    background: #10b981 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    border: 2px solid #059669 !important;
    position: relative !important;
    z-index: 15 !important;
    opacity: 1 !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.8px !important;
}

#create-farm-final:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #047857 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
}

#create-farm-final:not(.loading) {
    color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .progress-indicator {
        padding: 1.5rem 1rem;
    }
    
    .step {
        max-width: 80px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .review-section {
        gap: 1rem;
    }
    
    .review-card,
    .cost-breakdown,
    .approval-info {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-content {
        max-height: calc(100vh - 200px);
    }
    
    .progress-indicator::before {
        left: 20%;
        right: 20%;
    }
}