/* Hezarfen Modal System - Modern CSS-only Modal */

/* Contract Modal Triggers */
.hezarfen-contracts-modal-section {
    margin: 15px 0;
}

.hezarfen-contracts-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.contract-modal-btn,
.hezarfen-contract-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.contract-modal-btn:hover,
.hezarfen-contract-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal Base Styles */
.hezarfen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hezarfen-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    align-items: center;
    justify-content: center;
}

.hezarfen-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.hezarfen-modal-container {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hezarfen-modal.active .hezarfen-modal-container {
    transform: scale(1);
}

.hezarfen-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.hezarfen-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.hezarfen-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.hezarfen-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.hezarfen-modal-content {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.hezarfen-modal-content p {
    margin-bottom: 15px;
}

.hezarfen-modal-content h1,
.hezarfen-modal-content h2,
.hezarfen-modal-content h3,
.hezarfen-modal-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.hezarfen-modal-footer {
    padding: 15px 25px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.hezarfen-modal-footer p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.hezarfen-modal-footer .button {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.hezarfen-modal-footer .button:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hezarfen-modal-container {
        max-width: 95%;
        margin: 20px;
    }
    
    .hezarfen-modal-header,
    .hezarfen-modal-content,
    .hezarfen-modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hezarfen-contracts-section {
        flex-direction: column;
    }
    
    .contract-modal-btn,
    .hezarfen-contract-btn {
        width: 100%;
        text-align: center;
    }
}

/* Animation for smooth opening */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hezarfen-modal.active .hezarfen-modal-container {
    animation: modalFadeIn 0.3s ease forwards;
}

/* Ensure modal is above everything */
.hezarfen-modal {
    z-index: 999999 !important;
}