/* ========================================
   MODAL STYLES - SEPARATE FILE
======================================== */

/* Base modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.modal-content {
    background: var(--background-white, #ffffff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    z-index: 2001;
    animation: modalSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid rgba(107, 155, 122, 0.1);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #333);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #666);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    background: rgba(107, 155, 122, 0.1);
    color: var(--primary-color, #6b9b7a);
}

.modal-body {
    padding: 1rem 2rem 2rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.modal-body::-webkit-scrollbar {
    display: none; /* WebKit */
}

.modal-description {
    margin-bottom: 1rem;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

/* Form styles */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary, #333);
    font-size: 0.9rem;
}

.form-control {
    padding: 12px 16px;
    border: 2px solid rgba(107, 155, 122, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--background-white, #ffffff);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #6b9b7a);
    box-shadow: 0 0 0 3px rgba(107, 155, 122, 0.1);
}

.form-control::placeholder {
    color: #999;
}

.form-control[readonly] {
    background: rgba(107, 155, 122, 0.05);
    color: var(--primary-color, #6b9b7a);
    font-weight: 600;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
   /* margin: 0.25rem 0;*/
   padding: 0px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: normal;
}

.form-actions {
    margin-top: 0.5rem;
}

.form-note {
    margin-top: 0.1rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    text-align: center;
    line-height: 1.4;
}

.form-note a {
    color: var(--primary-color, #6b9b7a);
    text-decoration: none;
}

.form-note a:hover {
    text-decoration: underline;
}

/* Button styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #6b9b7a) 0%, #5a8a69 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 155, 122, 0.3);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Loading state */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Callback modal specific styles */
.callback-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
  /*  margin-bottom: 1.5rem;*/
    padding: 0.1rem;
    background: rgba(107, 155, 122, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(107, 155, 122, 0.1);
}

.callback-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.callback-feature .feature-icon {
    color: var(--primary-color, #6b9b7a);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(107, 155, 122, 0.1);
    border-radius: 50%;
}

/* Order modal specific styles */
.order-summary {
    background: rgba(107, 155, 122, 0.05);
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.order-title {
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.order-features {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.order-feature {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    border: 1.5px solid rgba(107, 155, 122, 0.3);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    min-height: 50px;
    text-align: left;
    flex: 1;
}

.order-feature:hover {
    border-color: var(--primary-color, #6b9b7a);
    background: rgba(107, 155, 122, 0.05);
}

.order-feature .feature-icon {
    font-size: 1rem;
    color: var(--primary-color, #6b9b7a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.order-feature .feature-icon svg {
    width: 20px;
    height: 20px;
}

.order-pricing {
    text-align: center;
}

.price-new {
    color: var(--primary-color, #6b9b7a);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.1rem 0;
}

.price-discount {
    background: linear-gradient(135deg, var(--primary-color, #6b9b7a), #5a8a69);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
}

/* Project modal specific styles */
.project-modal-content {
    max-width: 1100px !important;
    width: 90vw !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.project-modal-content .modal-body {
    padding: 1.5rem 2rem 2rem !important;
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
}

.project-modal-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
    align-items: start !important;
}

.project-modal-gallery {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.gallery-main {
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #000 !important;
    aspect-ratio: 4/3 !important;
}

.project-modal-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000 !important;
}

.gallery-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.gallery-prev {
    left: 10px !important;
}

.gallery-next {
    right: 10px !important;
}

.gallery-counter {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.gallery-thumbs {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding: 5px 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary-color, #6b9b7a) rgba(107, 155, 122, 0.1) !important;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px !important;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: rgba(107, 155, 122, 0.1) !important;
    border-radius: 3px !important;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--primary-color, #6b9b7a) !important;
    border-radius: 3px !important;
}

.gallery-thumb {
    flex-shrink: 0 !important;
    width: 70px !important;
    height: 70px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
}

.gallery-thumb:hover {
    border-color: rgba(107, 155, 122, 0.5) !important;
}

.gallery-thumb.active {
    border-color: var(--primary-color, #6b9b7a) !important;
}

.gallery-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.project-modal-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

.project-modal-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.project-modal-meta-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background: rgba(107, 155, 122, 0.05) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(107, 155, 122, 0.1) !important;
}

.project-modal-meta-item .meta-label {
    font-weight: 600 !important;
    color: var(--text-primary, #333) !important;
    font-size: 0.9rem !important;
}

.project-modal-meta-item .meta-value {
    color: var(--primary-color, #6b9b7a) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.project-modal-description,
.project-modal-details {
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    border: 1px solid rgba(107, 155, 122, 0.1) !important;
}

.project-modal-description h3,
.project-modal-details h3 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary, #333) !important;
    margin: 0 0 1rem 0 !important;
}

.project-modal-desc-text {
    color: var(--text-secondary, #666) !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.project-modal-details-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.project-modal-details-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0 !important;
    color: var(--text-secondary, #666) !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
}

.project-modal-details-list li::before {
    content: '' !important;
    width: 6px !important;
    height: 6px !important;
    background: var(--primary-color, #6b9b7a) !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    margin-top: 0.5rem !important;
}

.project-modal-cta {
    margin-top: 0.5rem !important;
}

.project-modal-cta .btn {
    width: 100% !important;
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem !important;
}

/* Certificate modal specific styles */
.certificate-modal-content {
    max-width: 900px !important;
    width: 90vw !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.certificate-modal-content .modal-body {
    padding: 0 !important;
}

.certificate-modal-body {
    display: flex !important;
    gap: 2rem !important;
    align-items: flex-start !important;
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    padding: 1rem 2rem 2rem !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* Internet Explorer 10+ */
}

.certificate-modal-body::-webkit-scrollbar {
    display: none !important; /* WebKit */
}

.certificate-image-container {
    flex: 1 !important;
    max-width: 500px !important;
    background: linear-gradient(135deg, rgba(248, 251, 249, 0.8) 0%, rgba(240, 248, 242, 0.9) 100%) !important;
    border-radius: 16px !important;
    padding: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.certificate-modal-image {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.3s ease !important;
}

.certificate-modal-image:hover {
    transform: scale(1.02) !important;
}

.certificate-modal-info {
    flex: 1 !important;
    min-width: 300px !important;
}

.certificate-modal-details {
    background: rgba(107, 155, 122, 0.05) !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid rgba(107, 155, 122, 0.1) !important;
}

.certificate-modal-details > div {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 1rem !important;
}

.certificate-modal-details > div:last-child {
    margin-bottom: 0 !important;
}

.certificate-modal-details .label {
    font-weight: 600 !important;
    color: var(--text-primary, #333) !important;
}

.certificate-modal-details .value {
    font-family: 'Courier New', monospace !important;
    font-weight: 500 !important;
    color: var(--text-secondary, #666) !important;
}

.certificate-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
}

.certificate-status-badge svg {
    width: 14px !important;
    height: 14px !important;
}

.certificate-modal-description {
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    border: 1px solid rgba(107, 155, 122, 0.1) !important;
}

.certificate-modal-description p {
    margin: 0 !important;
    color: var(--text-secondary, #666) !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
}

/* Telegram modal specific styles */
.telegram-summary {
    text-align: center;
    margin-bottom: 1.5rem;
}

.telegram-icon-large {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color, #6b9b7a);
}

.telegram-chat-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
}

.telegram-description {
    color: var(--text-secondary, #666);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.telegram-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.telegram-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(107, 155, 122, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(107, 155, 122, 0.1);
}

.telegram-feature .feature-icon {
    color: var(--primary-color, #6b9b7a);
    flex-shrink: 0;
}

.telegram-pricing {
    text-align: center;
    margin-bottom: 1.5rem;
}

.price-badge {
    background: linear-gradient(135deg, var(--primary-color, #6b9b7a), #5a8a69);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.spots-remaining {
    color: var(--text-secondary, #666);
    font-size: 0.85rem;
}

/* Mobile adaptations */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem 1.5rem 1.25rem;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .callback-features {
        padding: 1rem;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .callback-feature {
        flex-direction: row;
        text-align: left;
        gap: 0.75rem;
    }
    
    .order-features {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .order-feature {
        min-height: auto;
        padding: 0.75rem;
    }
    
    /* Project modal mobile */
    .project-modal-content {
        width: 95vw !important;
        max-width: none !important;
        max-height: 95vh !important;
    }
    
    .project-modal-content .modal-body {
        padding: 1rem 1.5rem 1.5rem !important;
    }
    
    .project-modal-body {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .gallery-main {
        aspect-ratio: 16/10 !important;
    }
    
    .project-modal-img {
        object-fit: contain !important;
    }
    
    .gallery-nav {
        width: 36px !important;
        height: 36px !important;
    }
    
    .gallery-prev {
        left: 8px !important;
    }
    
    .gallery-next {
        right: 8px !important;
    }
    
    .gallery-counter {
        bottom: 8px !important;
        right: 8px !important;
        padding: 5px 10px !important;
        font-size: 12px !important;
    }
    
    .gallery-thumbs {
        gap: 6px !important;
    }
    
    .gallery-thumb {
        width: 60px !important;
        height: 60px !important;
    }
    
    .project-modal-meta-item {
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
    }
    
    .project-modal-description,
    .project-modal-details {
        padding: 1rem !important;
    }
    
    .project-modal-description h3,
    .project-modal-details h3 {
        font-size: 1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .project-modal-details-list li {
        padding: 0.4rem 0 !important;
        font-size: 0.85rem !important;
    }
    
    .project-modal-cta .btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Certificate modal mobile */
    .certificate-modal-content {
        width: 95vw !important;
        max-width: none !important;
        max-height: 95vh !important;
    }
    
    .certificate-modal-body {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 0.75rem 1.5rem 1.25rem !important;
    }
    
    .certificate-image-container {
        max-width: none !important;
        padding: 1rem !important;
    }
    
    .certificate-modal-image {
        max-height: 250px !important;
    }
    
    .certificate-modal-info {
        min-width: auto !important;
    }
    
    .certificate-modal-details {
        padding: 1rem !important;
    }
    
    .certificate-modal-details > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }
    
    .certificate-modal-description {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem 1.25rem 0.5rem;
    }
    
    .modal-body {
        padding: 0.5rem 1.25rem 1rem;
    }
    
    .callback-features {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .callback-feature {
        font-size: 0.85rem;
    }
    
    .modal-form {
        gap: 0.75rem;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    textarea.form-control {
        min-height: 60px;
    }
    
    .order-feature {
        padding: 0.4rem 0.6rem;
        min-height: 40px;
        font-size: 0.75rem;
    }
    
    /* Project modal extra small screens */
    .project-modal-content {
        width: 98vw !important;
    }
    
    .project-modal-content .modal-body {
        padding: 0.75rem 1.25rem 1.25rem !important;
    }
    
    .project-modal-body {
        gap: 1.25rem !important;
    }
    
    .gallery-main {
        aspect-ratio: 4/3 !important;
    }
    
    .gallery-nav {
        width: 32px !important;
        height: 32px !important;
    }
    
    .gallery-thumb {
        width: 50px !important;
        height: 50px !important;
    }
    
    .project-modal-meta-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
        padding: 0.5rem !important;
    }
    
    .project-modal-description,
    .project-modal-details {
        padding: 0.875rem !important;
    }
    
    .project-modal-description h3,
    .project-modal-details h3 {
        font-size: 0.95rem !important;
    }
    
    .project-modal-desc-text {
        font-size: 0.875rem !important;
    }
    
    .project-modal-details-list li {
        font-size: 0.8rem !important;
    }
}