/* Pinterest Pin Generator Frontend Styles */

.pinterest-pin-generator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ppg-generator {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ppg-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ppg-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.ppg-actions .button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ppg-actions .button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.ppg-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    min-height: 600px;
}

.ppg-canvas-area {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.ppg-canvas-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    padding: 20px;
    position: relative;
}

.ppg-canvas-wrapper {
    position: relative;
    display: inline-block;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#ppg-canvas {
    display: block;
    background: #ffffff;
    border-radius: 4px;
}

.ppg-controls {
    background: #f8f9fa;
    padding: 25px;
    border-left: 1px solid #e9ecef;
}

.ppg-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ppg-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ppg-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.ppg-control {
    margin-bottom: 15px;
}

.ppg-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.ppg-control input[type="text"],
.ppg-control input[type="color"],
.ppg-control input[type="number"],
.ppg-control select,
.ppg-control textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.ppg-control input[type="text"]:focus,
.ppg-control input[type="color"]:focus,
.ppg-control input[type="number"]:focus,
.ppg-control select:focus,
.ppg-control textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ppg-control input[type="range"] {
    width: 100%;
}

.ppg-control .ppg-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.ppg-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.ppg-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ppg-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ppg-button.secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.ppg-button.success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.ppg-button.danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.ppg-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.ppg-color-picker {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.ppg-color-input {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    transition: border-color 0.3s ease;
}

.ppg-color-input:focus-within {
    border-color: #667eea;
}

.ppg-color-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.ppg-color-value {
    width: 60px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.ppg-color-name {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.ppg-font-selector {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ppg-font-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.ppg-font-option:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.ppg-font-option.selected {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ppg-text-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.ppg-text-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-size: 16px;
    line-height: 1.5;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.ppg-text-input:focus {
    outline: none;
    border-color: #667eea;
}

.ppg-preview {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ppg-preview h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.ppg-preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ppg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ppg-modal.show {
    opacity: 1;
}

.ppg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.ppg-modal.show .ppg-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.ppg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.ppg-modal-title {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

.ppg-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.ppg-modal-close:hover {
    color: #333;
}

.ppg-form-group {
    margin-bottom: 25px;
}

.ppg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.ppg-form-group input,
.ppg-form-group select,
.ppg-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

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

.ppg-form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.ppg-loading {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #e8f4fd;
    border: 2px solid #bae6fd;
    border-radius: 8px;
    color: #0c4a6e;
    font-weight: 600;
}

.ppg-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #bae6fd;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ppg-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.ppg-notice.success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #a7f3d0;
}

.ppg-notice.error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fecaca;
}

.ppg-notice.info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #bfdbfe;
}

.ppg-notice.warning {
    background: #fff7ed;
    color: #9a3412;
    border: 2px solid #fed7aa;
}

/* Responsive styles */
@media (max-width: 992px) {
    .ppg-main {
        grid-template-columns: 1fr;
    }
    
    .ppg-controls {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    .ppg-header {
        padding: 15px;
    }
    
    .ppg-header h2 {
        font-size: 20px;
    }
    
    .ppg-canvas-area {
        padding: 20px;
    }
    
    .ppg-modal-content {
        padding: 25px;
        width: 95%;
    }
    
    .ppg-font-selector {
        grid-template-columns: 1fr;
    }
}

/* Canvas interaction styles */
.ppg-canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.ppg-text-element {
    position: absolute;
    padding: 15px 25px;
    line-height: 1.3;
    font-weight: bold;
    text-align: center;
    cursor: move;
    user-select: none;
    pointer-events: auto;
    transition: box-shadow 0.3s ease;
}

.ppg-text-element:hover {
    box-shadow: 0 0 0 2px #667eea;
}

.ppg-text-element.selected {
    outline: 3px dashed #667eea;
    outline-offset: 2px;
}

.ppg-element-controls {
    position: absolute;
    top: -10px;
    right: -10px;
    display: none;
}

.ppg-text-element:hover .ppg-element-controls,
.ppg-text-element.selected .ppg-element-controls {
    display: block;
}

.ppg-control-button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.ppg-control-button:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.ppg-control-button.delete {
    background: #ff4757;
}

.ppg-control-button.delete:hover {
    background: #ff6b81;
}
