/* Invisplan Frontend Publisher - Public Styles */

:root {
    --ifp-primary: #667eea;
    --ifp-secondary: #764ba2;
    --ifp-success: #10b981;
    --ifp-warning: #f59e0b;
    --ifp-danger: #ef4444;
    --ifp-info: #3b82f6;
    --ifp-light: #f8f9fa;
    --ifp-dark: #1a202c;
    --ifp-border: #e5e7eb;
    --ifp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ifp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Form Wrapper */
.ifp-form-wrapper,
.ifp-my-posts-wrapper {
    max-width: 900px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Form Header */
.ifp-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.ifp-form-header h2 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ifp-primary) 0%, var(--ifp-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
}

.ifp-subtitle {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

.ifp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ifp-primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 20px;
}

.ifp-back-link svg {
    width: 18px;
    height: 18px;
}

/* Form Sections */
.ifp-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--ifp-shadow);
}

.ifp-form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--ifp-border);
}

.ifp-form-section:last-child {
    border-bottom: none;
}

.ifp-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ifp-dark);
    margin: 0 0 20px 0;
}

/* Form Groups */
.ifp-form-group {
    margin-bottom: 24px;
}

.ifp-label {
    display: block;
    font-weight: 600;
    color: var(--ifp-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.ifp-label .required {
    color: var(--ifp-danger);
}

.ifp-optional {
    font-weight: 400;
    color: #9ca3af;
}

/* Input Fields */
.ifp-input,
.ifp-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--ifp-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.ifp-input:focus,
.ifp-textarea:focus {
    outline: none;
    border-color: var(--ifp-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ifp-char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.ifp-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* Categories Grid */
.ifp-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ifp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ifp-checkbox-label:hover {
    background: var(--ifp-light);
}

.ifp-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Image Upload Area */
.ifp-image-upload-area {
    position: relative;
    border: 2px dashed var(--ifp-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ifp-image-upload-area:hover {
    border-color: var(--ifp-primary);
    background: rgba(102, 126, 234, 0.02);
}

.ifp-upload-placeholder svg {
    width: 64px;
    height: 64px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.ifp-upload-placeholder p {
    font-size: 16px;
    font-weight: 500;
    color: var(--ifp-dark);
    margin: 0 0 8px 0;
}

.ifp-upload-hint {
    fontSize: 13px;
    color: #9ca3af;
}

/* Image Preview */
.ifp-image-preview {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.ifp-image-preview img {
    width: 100%;
    border-radius: 8px;
}

.ifp-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ifp-shadow);
    transition: all 0.2s ease;
}

.ifp-remove-image:hover {
    background: white;
    transform: scale(1.1);
}

.ifp-remove-image svg {
    width: 20px;
    height: 20px;
    color: var(--ifp-danger);
}

/* Upload Progress */
.ifp-upload-progress {
    margin-top: 16px;
}

.ifp-progress-bar {
    height: 8px;
    background: var(--ifp-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ifp-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--ifp-primary) 0%, var(--ifp-secondary) 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.ifp-progress-text {
    font-size: 13px;
    color: #6b7280;
}

/* Buttons */
.ifp-button {
    display: inline-flex;
    align-items: cent gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.ifp-button svg {
    width: 18px;
    height: 18px;
}

.ifp-button-primary {
    background: linear-gradient(135deg, var(--ifp-primary) 0%, var(--ifp-secondary) 100%);
    color: white;
    box-shadow: var(--ifp-shadow);
}

.ifp-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ifp-shadow-lg);
}

.ifp-button-secondary {
    background: white;
    color: var(--ifp-dark);
    border: 2px solid var(--ifp-border);
}

.ifp-button-secondary:hover {
    border-color: var(--ifp-primary);
    color: var(--ifp-primary);
}

.ifp-button-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.ifp-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Messages */
.ifp-message {
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    animation: slideIn 0.3s ease-out;
}

.ifp-message.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--ifp-success);
}

.ifp-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--ifp-danger);
}

/* Notice */
.ifp-notice {
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.ifp-notice-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--ifp-warning);
}

.ifp-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--ifp-danger);
}

/* My Posts */
.ifp-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ifp-posts-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--ifp-dark);
    margin: 0;
}

.ifp-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.ifp-post-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--ifp-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ifp-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ifp-shadow-lg);
}

.ifp-post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.ifp-post-content {
    padding: 20px;
}

.ifp-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ifp-post-date {
    font-size: 13px;
    color: #9ca3af;
}

.ifp-post-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

.ifp-post-title a {
    color: var(--ifp-dark);
    text-decoration: none;
}

.ifp-post-title a:hover {
    color: var(--ifp-primary);
}

.ifp-post-excerpt {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.ifp-post-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--ifp-border);
}

.ifp-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ifp-action-btn svg {
    width: 14px;
    height: 14px;
}

.ifp-action-edit {
    background: #e0e7ff;
    color: var(--ifp-primary);
}

.ifp-action-edit:hover {
    background: #c7d2fe;
}

.ifp-action-view {
    background: #dbeafe;
    color: var(--ifp-info);
}

.ifp-action-view:hover {
    background: #bfdbfe;
}

.ifp-action-delete {
    background: #fee2e2;
    color: var(--ifp-danger);
}

.ifp-action-delete:hover {
    background: #fecaca;
}

/* Badges */
.ifp-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ifp-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.ifp-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.ifp-badge-secondary {
    background: #e5e7eb;
    color: #4b5563;
}

.ifp-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Empty State */
.ifp-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--ifp-shadow);
}

.ifp-empty-state svg {
    width: 80px;
    height: 80px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.ifp-empty-state p {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 24px;
}

/* Animation */
@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ifp-posts-grid {
        grid-template-columns: 1fr;
    }

    .ifp-form-actions {
        flex-direction: column;
    }

    .ifp-button {
        width: 100%;
        justify-content: center;
    }

    .ifp-categories-grid {
        grid-template-columns: 1fr;
    }
}