/**
 * Love Page - Create/Edit/Index/My Pages Styles
 */

:root {
    --lp-primary: #e91e63;
    --lp-primary-dark: #c2185b;
    --lp-accent: #ff5722;
    --lp-bg: #fafafa;
    --lp-text: #333;
    --lp-text-light: #666;
    --lp-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --lp-radius: 16px;
}

body {
    font-family: 'Heebo', sans-serif;
    background: url('/themes/8369/images/backg.jpg') repeat;
    background-color: #505050;
    margin: 0;
    color: var(--lp-text);
}

/* Page wrapper */
.lp-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Page header */
.lp-page-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, rgba(233,30,99,0.9), rgba(156,39,176,0.9));
    border-radius: 0 0 30px 30px;
    color: #fff;
    margin-bottom: 30px;
}

.lp-page-header h1 {
    font-size: 2em;
    margin: 0 0 10px;
}

.lp-page-header p {
    font-size: 1.1em;
    opacity: 0.9;
    margin: 0;
}

/* Category selector */
.lp-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.lp-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--lp-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-family: 'Heebo', sans-serif;
}

.lp-category-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--lp-shadow);
}

.lp-category-btn.active {
    border-color: var(--lp-primary);
    background: #fce4ec;
}

.lp-category-btn .cat-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.lp-category-btn .cat-name {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--lp-text);
}

.lp-category-btn .cat-count {
    font-size: 0.8em;
    color: var(--lp-text-light);
    margin-top: 3px;
}

/* Template grid */
.lp-templates-section {
    margin-bottom: 30px;
}

.lp-templates-section h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.lp-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.lp-template-card {
    height: 140px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
}

.lp-template-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.lp-template-card.selected {
    border-color: #ffd700;
    box-shadow: 0 0 0 2px #ffd700, 0 8px 25px rgba(0,0,0,0.2);
}

.lp-template-card .tpl-name {
    font-weight: 600;
    font-size: 0.95em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.lp-template-card .tpl-check {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ffd700;
    color: #333;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    line-height: 24px;
    text-align: center;
    font-weight: 700;
}

.lp-template-card.selected .tpl-check {
    display: block;
}

/* Create form */
.lp-create-form {
    background: rgba(255,255,255,0.95);
    border-radius: var(--lp-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--lp-shadow);
}

.lp-form-group {
    margin-bottom: 20px;
}

.lp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--lp-text);
}

.lp-form-group label .required {
    color: #e91e63;
}

.lp-form-group input[type="text"],
.lp-form-group input[type="date"],
.lp-form-group textarea,
.lp-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Heebo', sans-serif;
    font-size: 1em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.lp-form-group input:focus,
.lp-form-group textarea:focus,
.lp-form-group select:focus {
    outline: none;
    border-color: var(--lp-primary);
}

.lp-form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.lp-form-group .char-count {
    text-align: left;
    font-size: 0.85em;
    color: var(--lp-text-light);
    margin-top: 5px;
}

.lp-form-group .char-count.limit {
    color: #e91e63;
}

/* Photo upload */
.lp-photo-upload {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.lp-photo-slot {
    aspect-ratio: 1;
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.lp-photo-slot:hover {
    border-color: var(--lp-primary);
    background: #fce4ec;
}

.lp-photo-slot .upload-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.lp-photo-slot .upload-text {
    font-size: 0.85em;
    color: var(--lp-text-light);
}

.lp-photo-slot.has-photo {
    border-style: solid;
    border-color: #4caf50;
}

.lp-photo-slot.has-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-photo-slot .photo-remove {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(244,67,54,0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1em;
    display: none;
    z-index: 2;
}

.lp-photo-slot.has-photo .photo-remove {
    display: block;
}

/* Photo position selector */
.lp-photo-position-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.lp-position-option {
    padding: 12px 8px;
    background: #f5f5f5;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    font-family: 'Heebo', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--lp-text);
}

.lp-position-option:hover {
    background: #fce4ec;
}

.lp-position-option.active {
    border-color: var(--lp-primary);
    background: #fce4ec;
}

/* Mini preview layouts */
.pos-preview {
    width: 60px;
    height: 50px;
    margin: 0 auto 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.pos-preview .pos-img {
    background: #e91e63;
    opacity: 0.5;
    border-radius: 3px;
    min-height: 12px;
}

.pos-preview .pos-txt {
    background: repeating-linear-gradient(0deg, #ccc, #ccc 2px, transparent 2px, transparent 5px);
    opacity: 0.4;
    flex: 1;
    min-height: 8px;
    margin: 3px;
}

/* Top: image on top, text below */
.pos-preview-top {
    flex-direction: column;
}
.pos-preview-top .pos-img { height: 18px; margin: 3px; }

/* Right: image on right, text on left */
.pos-preview-right {
    flex-direction: row-reverse;
}
.pos-preview-right .pos-img { width: 22px; height: auto; margin: 3px; flex-shrink: 0; }

/* Left: image on left, text on right */
.pos-preview-left {
    flex-direction: row;
}
.pos-preview-left .pos-img { width: 22px; height: auto; margin: 3px; flex-shrink: 0; }

/* Bottom: text on top, image below */
.pos-preview-bottom {
    flex-direction: column-reverse;
}
.pos-preview-bottom .pos-img { height: 18px; margin: 3px; }

/* Animation selector */
.lp-animation-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.lp-animation-option {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    font-family: 'Heebo', sans-serif;
}

.lp-animation-option:hover {
    background: #fce4ec;
}

.lp-animation-option.active {
    border-color: var(--lp-primary);
    background: #fce4ec;
}

/* Checkbox group */
.lp-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--lp-primary);
}

/* Submit button */
.lp-submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Heebo', sans-serif;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,30,99,0.3);
}

.lp-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Error message */
.lp-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #ef9a9a;
}

/* Gallery grid (index & my-pages) */
.lp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.lp-gallery-card {
    background: rgba(255,255,255,0.95);
    border-radius: var(--lp-radius);
    overflow: hidden;
    box-shadow: var(--lp-shadow);
    transition: transform 0.3s;
    text-decoration: none;
    color: var(--lp-text);
    display: block;
}

.lp-gallery-card:hover {
    transform: translateY(-5px);
}

.lp-gallery-card .card-preview {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.lp-gallery-card .card-preview .preview-title {
    font-size: 1.3em;
    font-weight: 700;
}

.lp-gallery-card .card-info {
    padding: 15px;
    border-top: 1px solid #eee;
}

.lp-gallery-card .card-info .card-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.05em;
}

.lp-gallery-card .card-info .card-meta {
    font-size: 0.85em;
    color: var(--lp-text-light);
    display: flex;
    justify-content: space-between;
}

/* My pages actions */
.lp-page-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.lp-page-actions a,
.lp-page-actions button {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-family: 'Heebo', sans-serif;
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.lp-page-actions .btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.lp-page-actions .btn-share {
    background: #e8f5e9;
    color: #2e7d32;
}

.lp-page-actions .btn-delete {
    background: #ffebee;
    color: #c62828;
}

/* CTA section */
.lp-cta {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--lp-radius);
    margin-bottom: 30px;
    box-shadow: var(--lp-shadow);
}

.lp-cta h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--lp-primary);
}

.lp-cta p {
    color: var(--lp-text-light);
    margin-bottom: 20px;
    font-size: 1.05em;
}

.lp-cta .cta-btn {
    display: inline-block;
    padding: 14px 35px;
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lp-cta .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,30,99,0.3);
}

/* Empty state */
.lp-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.lp-empty .empty-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

/* Pagination */
.lp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}

.lp-pagination a,
.lp-pagination span {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.lp-pagination a {
    background: rgba(255,255,255,0.9);
    color: var(--lp-text);
}

.lp-pagination span.current {
    background: var(--lp-primary);
    color: #fff;
}

@media (max-width: 768px) {
    .lp-wrapper {
        padding: 10px;
    }
    .lp-page-header {
        padding: 25px 15px 20px;
    }
    .lp-page-header h1 {
        font-size: 1.5em;
    }
    .lp-categories {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .lp-category-btn {
        padding: 12px 8px;
    }
    .lp-category-btn .cat-icon {
        font-size: 1.5em;
    }
    .lp-templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .lp-template-card {
        height: 100px;
    }
    .lp-create-form {
        padding: 20px 15px;
    }
    .lp-photo-upload {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .lp-animation-options {
        grid-template-columns: repeat(3, 1fr);
    }
    .lp-gallery-grid {
        grid-template-columns: 1fr;
    }
}
