/**
 * Draft System Styles - Cleaned Version
 * =====================================
 * Essential styles for the user-specific draft system
 */

/* Compact Draft Controls for Add-to-Cart Area */
.memento-draft-controls-compact {
    display: inline-block;
    margin-left: 12px;
    vertical-align: top;
}

.btn-save-draft-compact,
.btn-edit-draft-compact {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    line-height: 1.2;
}

.btn-save-draft-compact:hover,
.btn-edit-draft-compact:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-save-draft-compact i,
.btn-edit-draft-compact i {
    font-size: 14px;
}



/* Draft Controls Container */
.memento-draft-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Make draft controls more prominent when in product summary */
.entry-summary .memento-draft-controls {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #007cba;
    margin: 16px 0;
    padding: 20px;
}

/* Draft Status Indicator */
.draft-status-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-in_progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.status-ready_for_review {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge.status-completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge i {
    font-size: 16px;
}

.draft-owner-info {
    color: #6c757d;
    font-size: 13px;
}

/* Draft Action Controls */
.draft-action-controls {
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-save-draft {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-save-draft:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-edit-draft {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-edit-draft:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-publish-draft {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-publish-draft:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Loading states for buttons */
.btn-save-draft.loading,
.btn-edit-draft.loading,
.btn-publish-draft.loading,
.btn-save-draft-compact.loading,
.btn-edit-draft-compact.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-save-draft.loading::after,
.btn-edit-draft.loading::after,
.btn-publish-draft.loading::after,
.btn-save-draft-compact.loading::after,
.btn-edit-draft-compact.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

/* Draft Edit Form */
.draft-edit-form {
    background: white;
    border-radius: 6px;
    padding: 24px;
    border: 1px solid #dee2e6;
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-header h3 {
    margin: 0 0 8px 0;
    color: #212529;
    font-size: 24px;
}

.form-header p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

.draft-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 1 1 100%;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 123, 186, 0.1);
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

/* Auto-save Status */
.auto-save-status {
    margin-top: 20px;
    padding: 16px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #005a87;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

/* View Only Mode */
.draft-view-only {
    text-align: center;
    padding: 20px;
}

.info-message {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .memento-draft-controls {
        padding: 16px;
        margin: 20px 0;
    }
    
    .draft-status-indicator {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .draft-action-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-save-draft,
    .btn-edit-draft,
    .btn-publish-draft {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    /* Compact controls responsive */
    .memento-draft-controls-compact {
        display: block;
        margin: 12px 0 0 0;
        text-align: center;
    }
    
    .btn-save-draft-compact,
    .btn-edit-draft-compact {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

}

@media (max-width: 480px) {
    .memento-draft-controls {
        padding: 12px;
    }
    
    .draft-edit-form {
        padding: 16px;
    }
    
    .form-header h3 {
        font-size: 20px;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.draft-saved {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.draft-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ========================================
   MY ACCOUNT DRAFTS PAGE STYLES
   ======================================== */

.memento-drafts-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Drafts Header */
.drafts-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #007cba;
}

.drafts-header h2 {
    margin: 0 0 15px 0;
    color: #212529;
    font-size: 32px;
    font-weight: 700;
}

.drafts-description {
    margin: 0;
    color: #6c757d;
    font-size: 18px;
    line-height: 1.6;
}

/* Draft Statistics */
.draft-statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-color: #007cba;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 8px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* No Drafts Message */
.no-drafts-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.no-drafts-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-drafts-message h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 24px;
}

.no-drafts-message p {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 16px;
    line-height: 1.6;
}

.no-drafts-message .btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 16px;
}

/* Drafts Table */
.drafts-table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.drafts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.drafts-table th {
    background: #f8f9fa;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drafts-table td {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.drafts-table tr:hover {
    background: #f8f9fa;
}

/* Draft Product Column */
.draft-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-thumbnail {
    flex-shrink: 0;
}

.draft-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.no-thumbnail {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6c757d;
}

.product-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.product-details h4 a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-details h4 a:hover {
    color: #007cba;
}

/* Product Name Column (New Structure) */
.product-name .product-title {
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
    line-height: 1.4;
}

.product-name .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-name .product-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

/* Book Cover Column */
.book-cover {
    text-align: center;
}

/* Last Edited Column */
.last-edited {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Product Price Column */
.product-price {
    text-align: center;
}

.product-price .price {
    font-weight: 600;
    color: #28a745;
}

.product-price .no-price {
    color: #6c757d;
    font-style: italic;
}

.draft-notes {
    color: #6c757d;
    font-style: italic;
}

/* Draft Status Column */
.draft-status {
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Date Columns */
.draft-created,
.draft-modified {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.no-date {
    color: #adb5bd;
    font-style: italic;
}

/* Actions Column */
.draft-actions {
    text-align: center;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    min-width: 80px;
}

.btn-edit-draft,
.btn-resume-draft {
    background: #007cba;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-edit-draft:hover,
.btn-resume-draft:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: white;
}

.btn-delete-draft {
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-draft:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.draft-status-select {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.draft-status-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 123, 186, 0.1);
}

/* Draft Messages */
#draft-messages {
    margin-top: 20px;
}

.draft-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

/* ========================================
   PRODUCTS ARCHIVE PAGE STYLES
   ======================================== */

.products-grid {
    background: #f8f9fa;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007cba;
}

.product-image {
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #007cba;
}

.product-price {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.product-actions {
    text-align: center;
    margin-top: 15px;
}

.btn-primary {
    background: #007cba;
    border-color: #007cba;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

.pagination-wrapper {
    margin-top: 40px;
}

.pagination .page-link {
    color: #007cba;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007cba;
    border-color: #007cba;
}

.pagination .page-link:hover {
    color: #005a87;
    background-color: #e9ecef;
}

/* Responsive Design for Drafts Page */
@media (max-width: 768px) {
    .memento-drafts-page {
        padding: 15px;
    }
    
    .drafts-header {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .drafts-header h2 {
        font-size: 24px;
    }
    
    .drafts-description {
        font-size: 16px;
    }
    
    .draft-statistics {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .drafts-table-wrapper {
        overflow-x: auto;
    }
    
    .drafts-table {
        min-width: 600px;
    }
    
    .drafts-table th,
    .drafts-table td {
        padding: 15px 10px;
    }
    
    .draft-product {
        gap: 10px;
    }
    
    .draft-thumbnail,
    .no-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 70px;
    }
    
    .draft-status-select {
        min-width: 100px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .draft-statistics {
        grid-template-columns: 1fr;
    }
    
    .drafts-table {
        min-width: 500px;
    }
    
    .drafts-table th,
    .drafts-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .draft-thumbnail,
    .no-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .product-details h4 {
        font-size: 14px;
    }
    
    .status-badge {
        padding: 6px 12px;
        font-size: 11px;
    }
}
