/*
Theme Name: FOTOSALE Styles
Description: Стили для плагина FOTOSALE (страница выбора фотографий и админка вордпресс)
Version: 1.4.0
License: GPLv2 or later
*/

/* --- СТРАНИЦА КЛИЕНТА (Шорткод [foto_select]) --- */

.fotosale-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3338;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.fotosale-dns-consent {
    margin-top: 8px;
    display: block;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}

.fotosale-dns-consent:hover {
    color: #4f46e5;
}

/* Форма входа */
.fotosale-login-box {
    max-width: 400px;
    margin: 60px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.fotosale-login-icon {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #4f46e5;
    font-size: 24px;
}

.fotosale-login-box h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fotosale-login-box p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px;
}

.fotosale-form-group {
    margin-bottom: 15px;
    text-align: left;
}

.fotosale-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.fotosale-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.2s;
}

.fotosale-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.fotosale-input-mono {
    font-family: "JetBrains Mono", monospace;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
}

.fotosale-btn-primary {
    width: 100%;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.fotosale-btn-primary:hover {
    background: #4338ca;
}

.fotosale-error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: left;
}

/* Сетка выбора фото */
.fotosale-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .fotosale-workspace-grid {
        grid-template-columns: 8fr 4fr;
    }
}

.fotosale-photos-section {
    background: #ffffff;
}

.fotosale-photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 550;
    color: #475569;
}

.fotosale-photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    max-height: 520px;
    overflow-y: auto;
}

@media (min-width: 576px) {
    .fotosale-photos-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 колонки по ТЗ */
    }
}

.fotosale-photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Зеленая рамка при установке чекбокса по ТЗ */
.fotosale-photo-item.selected {
    outline: 3px solid #10b981;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: scale(0.98);
}

.fotosale-photo-wrapper {
    position: relative;
    aspect-ratio: 3/4;
    background-color: #f1f5f9;
    overflow: hidden;
}

.fotosale-photo-img {
    width: 100%;
    height: 100%;
    object-cover: cover;
    display: block;
}

/* Водяной знак во избежание кражи превью */
.fotosale-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    transform: rotate(-30deg);
}

/* Поверх каждого фото расположен чекбокс по ТЗ */
.fotosale-checkbox-container {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fotosale-checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.fotosale-photo-id {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-family: monospace;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
}

.fotosale-delete-item {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    padding: 6px;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
}
.fotosale-delete-item:hover {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.fotosale-photo-footer {
    padding: 6px 10px;
    font-family: monospace;
    font-size: 9px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

.fotosale-photo-footer span {
    font-weight: bold;
    color: #1e293b;
}

/* Информационные правые блоки */
.fotosale-sidebar-section {
    display: flex;
    flex-col: column;
    flex-direction: column;
    gap: 20px;
}

.fotosale-block-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.fotosale-block-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.fotosale-help-tip {
    font-size: 10px;
    color: #64748b;
    font-style: italic;
    margin-top: 4px;
    display: block;
}

.fotosale-cart-info {
    font-size: 12px;
    color: #475569;
    margin-bottom: 15px;
}

.fotosale-cart-info div {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.fotosale-cart-info .total-row {
    font-weight: 800;
    font-size: 14px;
    color: #1e293b;
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
    margin-top: 5px;
}

.fotosale-cart-info .total-price {
    color: #10b981;
}

.fotosale-btn-secondary {
    width: 100%;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 8px;
    text-align: center;
}

.fotosale-btn-secondary:hover {
    background: #cbd5e1;
}

.fotosale-btn-success {
    width: 100%;
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 13px;
    font-weight: 750;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.fotosale-btn-success:hover {
    background: #059669;
}


/* --- МОДАЛЬНЫЕ ОКНА --- */
.fotosale-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.fotosale-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.fotosale-modal-header {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fotosale-modal-content {
    padding: 20px;
}

.fotosale-modal-items {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.fotosale-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted #f1f5f9;
    font-family: monospace;
    font-size: 12px;
    color: #334155;
}

.fotosale-detail-summary-text {
    background: #f1f5f9;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 15px;
}


/* --- АДМИНКА WORDPRESS --- */
.fotosale-admin-wrap {
    margin: 20px 20px 0 0;
    background: #ffffff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.fotosale-admin-header {
    background: #1d2327;
    color: #f0f0f1;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fotosale-admin-header h1 {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.fotosale-admin-tabs {
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    padding: 0 10px;
}

.fotosale-admin-tab-btn {
    border: none;
    background: none;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.fotosale-admin-tab-btn.active {
    color: #2271b1;
    border-color: #2271b1;
    background: #ffffff;
}

.fotosale-admin-body {
    padding: 20px;
}

/* Кнопка загрузки под таблицы по ТЗ */
.fotosale-bottom-actions {
    margin-top: 15px;
}

/* Валидатор кнопки загрузки по ТЗ:
Пока не заполнены все поля кнопка Загрузить группу фото имеет серый цвет фона и черный цвет текста.
После заполнения всех полей фон кнопки меняется на зеленый. Цвет текста - черный. */
.fotosale-btn-upload-group.disabled {
    background-color: #e2e8f0;
    color: #000000;
    cursor: not-allowed;
    border: 1px solid #cbd5e1;
}

.fotosale-btn-upload-group.active {
    background-color: #10b981;
    color: #000000;
    font-weight: bold;
    border: 1px solid #059669;
    cursor: pointer;
}

/* Кнопка +/- в колонках таблицы группы по ТЗ */
.fotosale-circle-action-btn-add {
    width: 32px;
    height: 32px;
    border: 1px solid #10b981;
    background-color: #ecfdf5;
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px; /* квадратная по ТЗ */
    cursor: pointer;
    line-height: 28px;
    text-align: center;
}

.fotosale-circle-action-btn-delete {
    width: 32px;
    height: 32px;
    border: 1px solid #ef4444;
    background-color: #fef2f2;
    color: #ef4444;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px; /* квадратная по ТЗ */
    cursor: pointer;
    line-height: 28px;
    text-align: center;
}
