/* VetPro - Components Styles */

/* ===============================================
   UNIVERSAL CARD COMPONENTS
   =============================================== */

/* Base Card Styles */
.base-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Исключение для карточек с популярным бейджиком */
.base-card.popular {
    overflow: visible;
}

.base-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.base-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.base-card:hover::before {
    transform: scaleX(1);
}

/* ===============================================
   UNIVERSAL UTILITY CLASSES
   =============================================== */

/* Flexbox utilities - используются 174+ раза */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-align {
    display: flex;
    align-items: center;
}

.flex-justify {
    display: flex;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* Border radius utilities - используются 63+ раза */
.rounded {
    border-radius: 0.75rem;
}

.rounded-md {
    border-radius: 0.5rem;
}

.rounded-lg {
    border-radius: 1rem;
}

.rounded-xl {
    border-radius: 1.5rem;
}

/* Background utilities */
.bg-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.bg-white-95 {
    background: rgba(255, 255, 255, 0.95);
}

/* Transition utilities - используются 29+ раз */
.transition {
    transition: all 0.2s ease;
}

.transition-slow {
    transition: all 0.3s ease;
}

/* Backdrop blur utilities */
.backdrop-blur-sm {
    backdrop-filter: blur(5px);
}

.backdrop-blur-md {
    backdrop-filter: blur(10px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(20px);
}

/* Header/Navigation backdrop */
.header-backdrop {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
}

/* ===============================================
   MODAL COMPONENTS
   =============================================== */

/* ===============================================
   BASIC MODAL STYLES
   =============================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.3s ease;
}

.modal.show,
.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 1.5rem;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    flex: 0 0 auto;
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 1.5rem 1.5rem 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modal-close i {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-body {
    padding: 1rem;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Компактные стили модалки - будут правильно переопределены в style.css */

.modal-actions {
    flex: 0 0 auto;
    padding: 2rem 2rem 3rem 2rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0 0 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions .btn-secondary {
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.3);
    color: var(--text-secondary);
}

.modal-actions .btn-secondary:hover {
    background: var(--muted-overlay);
    transform: translateY(-1px);
}

.modal-actions .btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    margin-bottom: 0;
}

.modal-actions .btn-primary i {
    flex-shrink: 0;
    align-self: center;
}

.modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.modal-actions .btn-example,
.modal-actions .btn-print,
.modal-actions .btn-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--text-secondary), #4b5563);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.modal-actions .btn-example:hover,
.modal-actions .btn-print:hover,
.modal-actions .btn-send:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-actions .btn-example i,
.modal-actions .btn-print i,
.modal-actions .btn-send i {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* ===============================================
   AUTH MODAL STYLES
   =============================================== */

.auth-description {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 0.6rem;
    margin-bottom: 0.75rem;
    color: #374151;
    font-size: 0.8rem;
    line-height: 1.3;
}

.auth-success {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon i {
    width: 2rem;
    height: 2rem;
    color: white;
}

.auth-success h3 {
    color: #1f2937;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.auth-success p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* Auth form compact spacing - will be overridden properly in style.css */

.auth-credits-notice {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding: 0.5rem 0.6rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--text-secondary);
    text-align: left;
}

/* ===============================================
   PURCHASE MODAL STYLES
   =============================================== */

#purchaseContent {
    text-align: center;
}

#purchaseContent h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

#purchaseContent .package-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 1rem 0;
}

#purchaseContent .package-details {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

#purchaseContent .package-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

#purchaseContent .package-details strong {
    color: #1f2937;
}

/* ===============================================
   PROFILE MODAL STYLES
   =============================================== */

.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.profile-modal.active {
    display: flex;
}

.profile-modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.profile-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.profile-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.profile-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.profile-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.profile-form-group {
    margin-bottom: 1.5rem;
}

.profile-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.profile-form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--border-primary);
}

.profile-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.profile-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.profile-btn-secondary:hover {
    background: #e5e7eb;
}

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

.profile-btn-primary:hover {
    background: #2563eb;
}

.profile-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.profile-btn-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.profile-btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
}

.profile-danger-zone {
    margin-top: 1rem;
}

.profile-danger-zone > div {
    display: flex;
    justify-content: center;
}

.profile-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ===============================================
   RESPONSIVE MODAL STYLES
   =============================================== */

/* Desktop specific modal sizes */
@media (min-width: 1024px) {
    #exampleModalMain .modal-content,
    #exampleModal .modal-content,
    #ownerExampleModal .modal-content,
    #vetComparisonModal .modal-content {
        max-width: 800px;
        width: 95%;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Выравниваем модальное окно по верху на мобильных */
    .modal {
        align-items: flex-start;
        overflow-y: auto;
        padding: 1rem 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 0 auto;
        max-width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    /* Уменьшенный заголовок модалки на мобильных */
    .modal-header h2 {
        font-size: 1rem;
        line-height: 1.2;
        max-width: 85%; /* Оставляем место для кнопки закрытия */
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Оптимизированная кнопка закрытия модалки */
    .modal-close {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.375rem;
        flex-shrink: 0;
    }
    
    .modal-close i {
        width: 1rem;
        height: 1rem;
    }
    
    .modal-body {
        padding: 1rem; /* Уменьшено с 1.5rem для экономии места */
        word-wrap: break-word;
    }
    
    .modal-actions {
        flex-direction: column;
        padding: 1.5rem 1rem 2rem 1rem;
    }
    
    .modal-actions .btn,
    .modal-actions a.btn {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
    
    /* Адаптация заголовка результатов для мобильных */
    .result-header {
        padding: 1.5rem 1rem;
    }
    
    .result-header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    .result-header p {
        font-size: 0.9rem;
    }
}

/* ===============================================
   RESULT PAGE UTILITIES
   =============================================== */

.result-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    background: #f8fafc;
}

.result-header {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.result-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.result-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 1;
    font-weight: 500;
    color: inherit;
}

.result-content {
    background: white;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1.5rem;
    text-align: center;
}
