.pag-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pag-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.pag-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.pag-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.pag-form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.pag-field {
    margin-bottom: 20px;
}

.pag-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.pag-field textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.pag-char-count {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.pag-char-count.warning {
    color: #ffc107;
}

.pag-char-count.danger {
    color: #dc3545;
}

.pag-style-options {
    display: flex;
    gap: 20px;
}

.pag-style-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.pag-style-options input[type="radio"] {
    margin-right: 8px;
}

#pag-generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#pag-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#pag-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pag-loading {
    display: inline-block;
}

.pag-result-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pag-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

#pag-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.pag-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pag-controls select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

#pag-download-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#pag-download-btn:hover {
    background: #218838;
}

.pag-stats {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.pag-stats div {
    margin: 5px 0;
}

.pag-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-top: 15px;
}

/* Responsive design */
@media (max-width: 768px) {
    .pag-container {
        padding: 15px;
    }
    
    .pag-header h2 {
        font-size: 24px;
    }
    
    .pag-form-container {
        padding: 20px;
    }
    
    .pag-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pag-controls select,
    #pag-download-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .pag-style-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* WordPress admin compatibility */
.wp-admin .pag-container {
    background: white;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wp-admin .pag-header {
    background: #0073aa;
}

.wp-admin #pag-generate-btn {
    background: #0073aa;
}

.wp-admin #pag-generate-btn:hover:not(:disabled) {
    background: #005a87;
}