/**
 * URL to Pin - Admin Styles
 */

/* Settings Page */
.utp-settings-wrap {
    max-width: 1200px;
}

.utp-settings-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.utp-settings-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    border-radius: 4px;
}

.utp-settings-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.utp-info-box {
    grid-column: span 2;
    background: #f0f6fc;
    border-color: #0073aa;
}

.utp-info-box ul {
    margin: 10px 0;
    padding-left: 20px;
}

.utp-info-box li {
    margin-bottom: 8px;
}

/* Generator Page */
.utp-generator-wrap {
    max-width: 1400px;
}

.utp-generator-container {
    margin-top: 20px;
}

.utp-input-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    border-radius: 4px;
    margin-bottom: 20px;
}

.utp-input-section h2 {
    margin-top: 0;
}

/* Usage Info */
.utp-usage-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.utp-usage-bar {
    width: 100%;
    height: 24px;
    background: #f0f0f1;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.utp-usage-progress {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #135e96);
    transition: width 0.3s ease;
}

/* Results Section */
.utp-results-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    border-radius: 4px;
}

.utp-results-section h2 {
    margin-top: 0;
    color: #00a32a;
}

.utp-generated-image {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.utp-generated-image img {
    display: block;
    margin: 15px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.utp-titles,
.utp-descriptions,
.utp-prompt-used {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.utp-title-option,
.utp-description-option {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.utp-title-option input,
.utp-description-option textarea {
    margin: 10px 0;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.utp-copy-btn {
    margin-top: 5px;
}

.utp-prompt-used textarea {
    margin-top: 10px;
    font-family: monospace;
    background: #fff;
}

/* Responsive */
@media (max-width: 782px) {
    .utp-settings-container {
        grid-template-columns: 1fr;
    }
    
    .utp-info-box {
        grid-column: span 1;
    }
}

/* Loading spinner fix */
.spinner.is-active {
    visibility: visible;
}

/* ========================================
   FRONT-END STYLES
   ======================================== */

.utp-frontend-container {
    max-width: 800px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Generator Box */
.utp-generator-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.utp-generator-box h2 {
    margin-top: 0;
    color: #333;
    font-size: 28px;
}

.utp-description {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
}

/* Form */
.utp-form {
    margin-top: 20px;
}

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

.utp-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 15px;
}

.utp-form-group input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.utp-form-group input[type="url"]:focus {
    outline: none;
    border-color: #e60023;
}

/* Usage Display */
.utp-usage-display {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.utp-usage-text {
    color: #555;
    font-size: 14px;
}

/* Submit Button */
.utp-submit-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e60023 0%, #c8001d 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(230, 0, 35, 0.2);
}

.utp-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(230, 0, 35, 0.3);
}

.utp-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.utp-spinner {
    font-size: 16px;
}

/* Messages */
.utp-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
}

.utp-message.utp-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.utp-message.utp-success {
    background: #efe;
    color: #0a0;
    border: 1px solid #cfc;
}

.utp-error {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #fcc;
    text-align: center;
    margin: 20px 0;
}

.utp-error a {
    color: #c00;
    text-decoration: underline;
    font-weight: 600;
}

/* Results Box */
.utp-results-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.4s ease;
}

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

.utp-results-title {
    color: #2ecc71;
    font-size: 26px;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Generated Image */
.utp-generated-image-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.utp-generated-image-box h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.utp-pin-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 20px 0;
}

.utp-download-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #2ecc71;
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.utp-download-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
    color: #fff !important;
}

/* Content Sections */
.utp-content-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.utp-content-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
}

.utp-helper-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Content Items */
.utp-content-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
}

.utp-content-item:last-child {
    margin-bottom: 0;
}

.utp-item-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #e60023;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.utp-item-text {
    flex: 1;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.utp-description-item .utp-item-text {
    font-size: 14px;
}

.utp-copy-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.utp-copy-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* Prompt Section */
.utp-prompt-section {
    margin-top: 30px;
    padding: 20px;
    background: #f0f6fc;
    border-left: 4px solid #3498db;
    border-radius: 6px;
}

.utp-prompt-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.utp-prompt-text {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'Courier New', monospace;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Image Actions */
.utp-image-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.utp-view-history-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #3498db;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.utp-view-history-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.utp-storage-notice {
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    color: #856404;
}

/* ========================================
   PIN HISTORY PAGE STYLES
   ======================================== */

.utp-history-wrap {
    max-width: 1400px;
}

.utp-pin-count {
    font-size: 18px;
    color: #666;
    font-weight: normal;
}

.utp-storage-info {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.utp-storage-info p {
    margin: 0;
    color: #0c5460;
}

.utp-admin-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

.utp-admin-notice strong {
    color: #856404;
}

.utp-no-pins {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.utp-no-pins p {
    font-size: 18px;
    color: #666;
}

/* Pin Cards Grid */
.utp-pins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.utp-pin-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.utp-pin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.utp-pin-card.utp-compact {
    display: flex;
    flex-direction: column;
}

.utp-pin-header {
    background: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.utp-pin-date {
    font-size: 11px;
    color: #666;
}

.utp-pin-expires {
    font-size: 11px;
    padding: 2px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 3px;
    font-weight: 600;
}

.utp-pin-image {
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    flex-shrink: 0;
}

.utp-pin-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    max-height: 350px;
    object-fit: cover;
}

.utp-pin-compact-info {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.utp-pin-compact-info h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.utp-toggle-details {
    width: 100%;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
}

.utp-toggle-details:hover {
    background: #e9ecef;
}

.utp-pin-details {
    padding: 15px;
    border-top: 1px solid #eee;
}

.utp-detail-section {
    margin: 15px 0;
}

.utp-detail-section strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 13px;
}

.utp-copy-area {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.utp-copy-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

.utp-content-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
}

.utp-content-row:last-child {
    margin-bottom: 0;
}

.utp-content-row .utp-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #e60023;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.utp-content-row .utp-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.utp-desc-row .utp-text {
    font-size: 13px;
}

.utp-content-row .button-small {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 12px;
}

.utp-pin-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.utp-pin-actions .button-primary {
    flex: 1;
    text-align: center;
    font-size: 13px;
}

.utp-pin-actions form {
    flex: 0;
}

.utp-pin-actions .button-link-delete {
    font-size: 12px;
}

/* Pagination */
.utp-pagination {
    margin: 30px 0;
    text-align: center;
}

.utp-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.utp-pagination .page-numbers:hover {
    background: #e60023;
    color: #fff;
    border-color: #e60023;
}

.utp-pagination .page-numbers.current {
    background: #e60023;
    color: #fff;
    border-color: #e60023;
}

/* Responsive */
@media (max-width: 768px) {
    .utp-frontend-container {
        margin: 20px;
    }
    
    .utp-generator-box,
    .utp-results-box {
        padding: 20px;
    }
    
    .utp-content-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .utp-copy-btn {
        align-self: flex-end;
    }
    
    .utp-pins-grid {
        grid-template-columns: 1fr;
    }
    
    .utp-pin-header {
        font-size: 12px;
    }
    
    .utp-content-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .utp-content-row .button-small {
        align-self: flex-end;
    }
    
    .utp-pin-actions {
        flex-direction: column;
    }
    
    .utp-pin-actions .button-primary {
        width: 100%;
    }
}

