/* === ICENI FRONTEND STYLES === */

/* Базовые стили формы */
.iceni-ad-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.iceni-form-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.iceni-form-title {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.iceni-form-progress {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.iceni-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.iceni-progress-step.active {
    opacity: 1;
}

.iceni-step-number {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.iceni-progress-step.active .iceni-step-number {
    background: white;
    color: #667eea;
    border-color: white;
}

.iceni-step-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Стили шагов формы */
.iceni-form-step {
    display: none;
    padding: 32px;
}

.iceni-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.iceni-form-section {
    margin-bottom: 32px;
}

.iceni-section-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.iceni-section-description {
    margin: 0 0 20px 0;
    color: #718096;
    font-size: 14px;
    line-height: 1.5;
}

/* Стили выбора типа */
.iceni-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.iceni-type-option input[type="radio"] {
    display: none;
}

.iceni-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.iceni-type-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.iceni-type-option input[type="radio"]:checked + .iceni-type-card {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.iceni-type-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.iceni-type-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.iceni-type-desc {
    font-size: 12px;
    color: #718096;
    line-height: 1.4;
}

/* Стили категорий */
.iceni-category-search {
    margin-bottom: 16px;
}

.iceni-category-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.iceni-category-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.iceni-category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.iceni-category-item {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.iceni-category-item:hover {
    border-color: #667eea;
    background: #f7faff;
}

.iceni-category-item.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.iceni-category-name {
    font-size: 14px;
    font-weight: 500;
}

.iceni-no-categories {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-style: italic;
}

/* Базовые элементы формы */
.iceni-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.iceni-form-input,
.iceni-form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.iceni-form-input:focus,
.iceni-form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.iceni-form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.iceni-char-counter {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    text-align: right;
}

.iceni-char-counter.error {
    color: #e53e3e;
    font-weight: 500;
}

/* Стили цены */
.iceni-price-container {
    position: relative;
    max-width: 200px;
}

.iceni-price-input {
    padding-right: 40px;
}

.iceni-currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-weight: 500;
}

.iceni-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.iceni-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.iceni-checkbox input[type="checkbox"] {
    display: none;
}

.iceni-checkbox-label {
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    line-height: 1.4;
}

.iceni-checkbox-label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
}

.iceni-checkbox input[type="checkbox"]:checked + .iceni-checkbox-label:before {
    background: #667eea;
    border-color: #667eea;
}

.iceni-checkbox input[type="checkbox"]:checked + .iceni-checkbox-label:after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: -1px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Стили загрузки изображений */
.iceni-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.iceni-upload-area:hover {
    border-color: #667eea;
    background: #f7faff;
}

.iceni-upload-content {
    pointer-events: none;
}

.iceni-upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.iceni-upload-text {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 12px;
    font-weight: 500;
}

.iceni-upload-hint {
    font-size: 12px;
    color: #718096;
    margin-top: 8px;
}

.iceni-image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.iceni-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.iceni-image-item.iceni-main-image {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.iceni-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.iceni-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iceni-image-item:hover .iceni-image-remove {
    opacity: 1;
}

.iceni-image-actions {
    position: absolute;
    bottom: 4px;
    left: 4px;
}

.iceni-image-set-main {
    width: 24px;
    height: 24px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iceni-image-item:hover .iceni-image-set-main {
    opacity: 1;
}

.iceni-image-item.iceni-main-image .iceni-image-set-main {
    opacity: 1;
    background: rgba(247, 183, 49, 0.9);
}

.iceni-image-counter {
    text-align: center;
    font-size: 12px;
    color: #718096;
    margin-bottom: 16px;
}

/* Стили контактов */
.iceni-contact-display {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.iceni-contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.iceni-contact-item:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.iceni-contact-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.iceni-contact-info {
    flex: 1;
}

.iceni-contact-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 2px;
}

.iceni-contact-value {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.iceni-privacy-settings {
    margin-top: 20px;
}

/* Стили соглашения */
.iceni-agreement {
    background: #fffaf0;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.iceni-agreement .iceni-checkbox-label {
    font-size: 14px;
    line-height: 1.5;
}

.iceni-agreement a {
    color: #667eea;
    text-decoration: none;
}

.iceni-agreement a:hover {
    text-decoration: underline;
}

/* Стили превью */
.iceni-preview-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.iceni-preview-card {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.iceni-preview-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.iceni-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iceni-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 12px;
}

.iceni-preview-content {
    flex: 1;
    min-width: 0;
}

.iceni-preview-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.iceni-preview-price {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.iceni-preview-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.iceni-preview-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #718096;
}

.iceni-preview-meta span {
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Навигация */
.iceni-form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.iceni-final-navigation {
    justify-content: flex-end;
    gap: 16px;
}

/* Кнопки */
.iceni-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1;
}

.iceni-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.iceni-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.iceni-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.iceni-btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.iceni-btn-secondary:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.iceni-btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.iceni-btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.iceni-btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.iceni-btn-outline:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

/* Сообщения */
.iceni-form-messages {
    margin-top: 20px;
}

.iceni-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.iceni-message.success {
    background: #f0fff4;
    color: #276749;
    border-left-color: #48bb78;
}

.iceni-message.error {
    background: #fff5f5;
    color: #c53030;
    border-left-color: #f56565;
}

.iceni-message.warning {
    background: #fffaf0;
    color: #d69e2e;
    border-left-color: #ed8936;
}

/* Подсказки и советы */
.iceni-form-tips {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    font-size: 13px;
}

.iceni-form-tips strong {
    color: #2d3748;
    display: block;
    margin-bottom: 8px;
}

.iceni-form-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #718096;
}

.iceni-form-tips li {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Адаптивность */
@media (max-width: 768px) {
    .iceni-ad-form-container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .iceni-form-header {
        padding: 24px 20px 20px;
    }
    
    .iceni-form-title {
        font-size: 24px;
    }
    
    .iceni-form-progress {
        gap: 20px;
    }
    
    .iceni-step-label {
        font-size: 10px;
    }
    
    .iceni-form-step {
        padding: 24px 20px;
    }
    
    .iceni-type-selector {
        grid-template-columns: 1fr;
    }
    
    .iceni-category-list {
        grid-template-columns: 1fr;
    }
    
    .iceni-preview-card {
        flex-direction: column;
        text-align: center;
    }
    
    .iceni-preview-image {
        width: 100%;
        height: 200px;
    }
    
    .iceni-form-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .iceni-btn {
        width: 100%;
    }
    
    .iceni-final-navigation {
        flex-direction: column-reverse;
    }
}

@media (max-width: 480px) {
    .iceni-form-progress {
        gap: 12px;
    }
    
    .iceni-step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .iceni-step-label {
        font-size: 9px;
    }
    
    .iceni-type-card {
        padding: 20px 12px;
    }
    
    .iceni-type-icon {
        font-size: 24px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.iceni-form-step.active {
    animation: slideIn 0.3s ease;
}

/* Утилиты */
.iceni-hidden {
    display: none !important;
}

.iceni-text-center {
    text-align: center;
}

.iceni-text-left {
    text-align: left;
}

.iceni-text-right {
    text-align: right;
}

.iceni-mt-0 { margin-top: 0; }
.iceni-mb-0 { margin-bottom: 0; }
.iceni-mt-1 { margin-top: 8px; }
.iceni-mb-1 { margin-bottom: 8px; }
.iceni-mt-2 { margin-top: 16px; }
.iceni-mb-2 { margin-bottom: 16px; }
.iceni-mt-3 { margin-top: 24px; }
.iceni-mb-3 { margin-bottom: 24px; }

/* Загрузка */
.iceni-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}