/**
 * POA Submission System - Public Styles
 */

/* Variables */
:root {
    --poa-primary: #1e3a5f;
    --poa-primary-hover: #2c5282;
    --poa-secondary: #718096;
    --poa-success: #38a169;
    --poa-warning: #d69e2e;
    --poa-danger: #e53e3e;
    --poa-light: #f7fafc;
    --poa-border: #e2e8f0;
    --poa-text: #2d3748;
    --poa-text-light: #718096;
    --poa-radius: 8px;
    --poa-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --poa-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
.poa-submission-form-wrapper,
.poa-my-submissions-wrapper,
.poa-privacy-policy {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--poa-text);
}

/* Language Switcher */
.poa-language-switcher {
    text-align: right;
    margin-bottom: 20px;
    font-size: 14px;
}

.poa-language-switcher a {
    color: var(--poa-secondary);
    text-decoration: none;
    padding: 5px 10px;
}

.poa-language-switcher a:hover,
.poa-language-switcher a.active {
    color: var(--poa-primary);
    font-weight: 600;
}

.poa-language-switcher .separator {
    color: var(--poa-border);
}

/* Buttons */
.poa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--poa-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.poa-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.poa-btn-primary {
    background: var(--poa-primary);
    color: #fff;
}

.poa-btn-primary:hover {
    background: var(--poa-primary-hover);
    color: #fff;
}

.poa-btn-secondary {
    background: var(--poa-light);
    color: var(--poa-text);
    border: 1px solid var(--poa-border);
}

.poa-btn-secondary:hover {
    background: #edf2f7;
}

.poa-btn-danger {
    background: #fff5f5;
    color: var(--poa-danger);
    border: 1px solid #fed7d7;
}

.poa-btn-danger:hover {
    background: #fed7d7;
}

/* Form Header */
.poa-form-header,
.poa-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.poa-form-header h2,
.poa-page-header h2 {
    margin: 0;
    font-size: 28px;
    color: var(--poa-primary);
}

/* Status Badge */
.poa-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.poa-status-editing {
    background: #fef3c7;
    color: #92400e;
}

.poa-status-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.poa-status-received {
    background: #d1fae5;
    color: #065f46;
}

.poa-status-withdrawn {
    background: #fee2e2;
    color: #991b1b;
}

/* Fieldset */
.poa-fieldset {
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    padding: 25px;
    margin-bottom: 25px;
    background: #fff;
}

.poa-fieldset legend {
    font-size: 16px;
    font-weight: 600;
    color: var(--poa-primary);
    padding: 0 10px;
}

/* Form Groups */
.poa-form-row {
    margin-bottom: 20px;
}

.poa-form-row:last-child {
    margin-bottom: 0;
}

.poa-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .poa-form-row-2col {
        grid-template-columns: 1fr;
    }
}

.poa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--poa-text);
}

.poa-form-group label .required {
    color: var(--poa-danger);
}

.poa-form-group input[type="text"],
.poa-form-group input[type="email"],
.poa-form-group select,
.poa-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.poa-form-group input:focus,
.poa-form-group select:focus,
.poa-form-group textarea:focus {
    outline: none;
    border-color: var(--poa-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.poa-field-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--poa-text-light);
}

/* Checkbox Group */
.poa-checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.poa-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

/* Word Count */
.poa-word-count {
    text-align: right;
    font-size: 13px;
    color: var(--poa-text-light);
    margin-bottom: 8px;
}

.poa-word-count.exceeded {
    color: var(--poa-danger);
    font-weight: 600;
}

/* Co-authors */
.poa-coauthors-list {
    margin-bottom: 15px;
}

.poa-coauthor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--poa-light);
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    margin-bottom: 10px;
}

.poa-coauthor-handle {
    cursor: grab;
    color: var(--poa-secondary);
}

.poa-coauthor-handle:active {
    cursor: grabbing;
}

.poa-coauthor-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 600px) {
    .poa-coauthor-fields {
        grid-template-columns: 1fr;
    }
}

.poa-coauthor-fields input {
    padding: 10px;
    border: 1px solid var(--poa-border);
    border-radius: 6px;
    font-size: 14px;
}

.poa-btn-remove-coauthor {
    background: none;
    border: none;
    color: var(--poa-danger);
    cursor: pointer;
    padding: 5px;
}

.poa-btn-remove-coauthor:hover {
    background: #fee2e2;
    border-radius: 4px;
}

/* Current File */
.poa-current-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--poa-light);
    border-radius: var(--poa-radius);
    margin-bottom: 15px;
}

.poa-current-file .dashicons {
    color: var(--poa-primary);
}

.poa-current-file a {
    flex: 1;
    color: var(--poa-primary);
}

.poa-btn-remove {
    background: none;
    border: 1px solid var(--poa-danger);
    color: var(--poa-danger);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Privacy Agreement */
.poa-privacy-agreement {
    margin-top: 25px;
    padding: 15px 20px;
    background: var(--poa-light);
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
}

.poa-privacy-agreement a {
    color: var(--poa-primary);
    text-decoration: underline;
}

.poa-privacy-agreement a:hover {
    color: var(--poa-primary-hover);
}

/* Form Actions */
.poa-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--poa-border);
    flex-wrap: wrap;
    gap: 15px;
}

.poa-form-actions-left,
.poa-form-actions-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.poa-save-status {
    font-size: 13px;
    color: var(--poa-success);
}

/* Submissions List */
.poa-submissions-list {
    display: grid;
    gap: 20px;
}

.poa-submission-card {
    background: #fff;
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    box-shadow: var(--poa-shadow);
    overflow: hidden;
}

.poa-submission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: var(--poa-light);
    border-bottom: 1px solid var(--poa-border);
    gap: 15px;
    flex-wrap: wrap;
}

.poa-submission-title {
    margin: 0;
    font-size: 18px;
    color: var(--poa-text);
}

.poa-submission-card-body {
    padding: 20px;
}

.poa-submission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.poa-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--poa-text-light);
}

.poa-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.poa-yia-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 12px;
}

.poa-confirmed-notice {
    margin-top: 15px;
    color: var(--poa-success);
    display: flex;
    align-items: center;
    gap: 6px;
}

.poa-submission-card-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--poa-light);
    border-top: 1px solid var(--poa-border);
    flex-wrap: wrap;
}

.poa-withdrawn-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--poa-danger);
    font-size: 14px;
}

/* Empty State */
.poa-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--poa-light);
    border-radius: var(--poa-radius);
}

.poa-empty-state .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: var(--poa-border);
    margin-bottom: 20px;
}

.poa-empty-state h3 {
    margin: 0 0 10px;
    color: var(--poa-text);
}

.poa-empty-state p {
    color: var(--poa-text-light);
    margin-bottom: 20px;
}

.poa-submission-closed-notice {
    color: var(--poa-warning);
    font-weight: 500;
}

/* Login Box */
.poa-login-box,
.poa-login-required {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    box-shadow: var(--poa-shadow);
}

.poa-login-box h3,
.poa-login-required h3 {
    margin: 0 0 15px;
    color: var(--poa-primary);
}

.poa-google-login {
    margin-top: 20px;
}

/* Submission Closed */
.poa-submission-closed {
    text-align: center;
    padding: 40px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--poa-radius);
}

.poa-submission-closed h3 {
    margin: 0 0 15px;
    color: #92400e;
}

/* Privacy Policy */
.poa-privacy-policy h1 {
    color: var(--poa-primary);
    margin-bottom: 10px;
}

.poa-privacy-policy .poa-last-updated {
    color: var(--poa-text-light);
    font-size: 14px;
    margin-bottom: 30px;
}

.poa-privacy-policy h2 {
    color: var(--poa-text);
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.poa-privacy-policy ul {
    padding-left: 20px;
}

.poa-privacy-policy li {
    margin-bottom: 8px;
}

/* Error Message */
.poa-error {
    padding: 20px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--poa-radius);
    color: #991b1b;
    text-align: center;
}

/* Loading State */
.poa-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.poa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--poa-border);
    border-top-color: var(--poa-primary);
    border-radius: 50%;
    animation: poa-spin 0.8s linear infinite;
}

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

/* TinyMCE Override */
.poa-form .mce-tinymce {
    border-radius: var(--poa-radius) !important;
}

/* Figure Upload Section */
.poa-figure-upload-group {
    background: var(--poa-light);
    border: 1px solid var(--poa-border);
    border-radius: var(--poa-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.poa-figure-upload-group:last-child {
    margin-bottom: 0;
}

.poa-figure-title {
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--poa-primary);
}

.poa-current-figure {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.poa-figure-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--poa-border);
}

.poa-form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed var(--poa-border);
    border-radius: var(--poa-radius);
    background: #fff;
    width: 100%;
    cursor: pointer;
}

/* Custom file input button - English text */
.poa-form-group input[type="file"]::file-selector-button {
    background: var(--poa-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
    transition: background 0.2s ease;
}

.poa-form-group input[type="file"]::file-selector-button:hover {
    background: var(--poa-primary-dark, #152a47);
}

/* Webkit browsers (Chrome, Safari, Edge) */
.poa-form-group input[type="file"]::-webkit-file-upload-button {
    background: var(--poa-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
    transition: background 0.2s ease;
}

.poa-form-group input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--poa-primary-dark, #152a47);
}

.poa-form-group input[type="file"]:hover {
    border-color: var(--poa-primary);
    background: rgba(30, 58, 95, 0.02);
}

.poa-form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--poa-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .poa-submission-form-wrapper,
    .poa-my-submissions-wrapper {
        padding: 15px;
    }

    .poa-fieldset {
        padding: 15px;
    }

    .poa-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .poa-form-actions-left,
    .poa-form-actions-right {
        justify-content: center;
    }
}
