/**
 * AIDB Job Matching - Frontend Styles
 */

/* Reset and base */
.ajm-form-container,
.ajm-job-list,
.ajm-dashboard,
.ajm-my-applications,
.ajm-register-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    line-height: 1.7;
    color: #1f2937;
}

/* Buttons */
.ajm-btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.5;
}

.ajm-btn-primary {
    background: #2563eb;
    color: #fff;
}

.ajm-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.ajm-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ajm-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.ajm-btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.ajm-btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

.ajm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Notices */
.ajm-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ajm-notice-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.ajm-notice-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.ajm-notice-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ajm-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Forms */
.ajm-form {
    margin-top: 20px;
}

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

.ajm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.ajm-form-group label .required {
    color: #dc2626;
}

.ajm-form-group input[type="text"],
.ajm-form-group input[type="email"],
.ajm-form-group input[type="url"],
.ajm-form-group input[type="number"],
.ajm-form-group input[type="password"],
.ajm-form-group textarea,
.ajm-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.ajm-form-group input:focus,
.ajm-form-group textarea:focus,
.ajm-form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ajm-form-row {
    display: flex;
    gap: 20px;
}

.ajm-form-half {
    flex: 1;
}

.ajm-field-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.ajm-form-description {
    color: #6b7280;
    margin-bottom: 24px;
}

.ajm-form-actions {
    margin-top: 30px;
    text-align: center;
}

.ajm-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
}

.ajm-form-message.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.ajm-form-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ajm-form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

/* Budget fields */
.ajm-budget-fields {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ajm-budget-fields input[type="number"] {
    width: 120px;
}

.ajm-budget-fields select {
    width: auto;
}

/* Checkbox grid */
.ajm-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ajm-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400 !important;
}

.ajm-checkbox-label:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.ajm-checkbox-label input:checked + * {
    color: #2563eb;
}

.ajm-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.ajm-skill-category {
    margin-bottom: 16px;
}

.ajm-skill-category h4 {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Skill tags */
.ajm-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.ajm-skill-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Job list */
.ajm-job-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.ajm-job-list-header h2 {
    margin: 0;
}

.ajm-job-count {
    color: #6b7280;
    font-size: 14px;
}

.ajm-job-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ajm-job-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s;
}

.ajm-job-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ajm-job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ajm-job-type-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.ajm-job-date {
    color: #9ca3af;
    font-size: 13px;
}

.ajm-job-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.ajm-job-title a {
    color: #111827;
    text-decoration: none;
}

.ajm-job-title a:hover {
    color: #2563eb;
}

.ajm-job-company {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 10px;
}

.ajm-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 10px 0;
}

.ajm-meta-item {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ajm-meta-budget {
    font-weight: 600;
    color: #059669;
}

.ajm-job-excerpt {
    color: #6b7280;
    font-size: 14px;
    margin: 12px 0;
    line-height: 1.6;
}

.ajm-job-card-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.ajm-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
}

.ajm-pagination .page-numbers.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* Dashboard */
.ajm-dashboard-actions {
    margin-bottom: 24px;
}

.ajm-dashboard-job {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.ajm-dashboard-job-header {
    margin-bottom: 16px;
}

.ajm-dashboard-job-header h3 {
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ajm-dashboard-job-header h3 a {
    color: #111827;
    text-decoration: none;
}

.ajm-dashboard-job-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.ajm-link {
    color: #2563eb;
    text-decoration: none;
}

.ajm-link:hover {
    text-decoration: underline;
}

/* Status badges */
.ajm-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.ajm-status-publish,
.ajm-status-pending {
    background: #dbeafe;
    color: #1d4ed8;
}

.ajm-status-accepted {
    background: #d1fae5;
    color: #065f46;
}

.ajm-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.ajm-status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

.ajm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

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

/* Applicant cards */
.ajm-applicants {
    margin-top: 16px;
}

.ajm-applicants h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #374151;
}

.ajm-applicant-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    background: #fafafa;
}

.ajm-applicant-card.ajm-disclosed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.ajm-applicant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ajm-applicant-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ajm-applicant-date {
    font-size: 13px;
    color: #9ca3af;
}

.ajm-applicant-bio {
    color: #4b5563;
    font-size: 14px;
    margin: 8px 0;
}

.ajm-applicant-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

.ajm-applicant-message {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
}

.ajm-applicant-message p {
    margin: 4px 0 0;
}

.ajm-no-applicants {
    color: #9ca3af;
    font-style: italic;
    padding: 10px 0;
}

/* Locked info */
.ajm-locked-info {
    margin-top: 16px;
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
}

.ajm-lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9ca3af;
    margin-bottom: 12px;
    font-size: 14px;
}

.ajm-lock-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Disclosed info */
.ajm-disclosed-info {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.ajm-disclosed-info h5 {
    margin: 0 0 12px;
    color: #15803d;
    font-size: 14px;
}

.ajm-disclosed-info p {
    margin: 6px 0;
    font-size: 14px;
}

.ajm-experience {
    margin-top: 12px;
}

.ajm-experience p {
    white-space: pre-line;
}

/* Application items */
.ajm-applications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ajm-application-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.ajm-application-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ajm-application-header h3 {
    margin: 0;
    font-size: 16px;
}

.ajm-application-header h3 a {
    color: #111827;
    text-decoration: none;
}

.ajm-application-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.ajm-application-message {
    margin-top: 12px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
}

/* Register */
.ajm-role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.ajm-role-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ajm-role-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.ajm-role-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.ajm-role-icon {
    margin-bottom: 16px;
}

.ajm-role-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #2563eb;
}

.ajm-role-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.ajm-role-card p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.ajm-role-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.ajm-role-card ul li {
    padding: 4px 0;
    font-size: 13px;
    color: #4b5563;
}

.ajm-role-card ul li::before {
    content: "✓ ";
    color: #059669;
    font-weight: bold;
}

/* Job detail meta table */
.ajm-job-detail-meta {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.ajm-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.ajm-detail-table th {
    text-align: left;
    padding: 8px 16px 8px 0;
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    width: 120px;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
}

.ajm-detail-table td {
    padding: 8px 0;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.ajm-detail-table tr:last-child th,
.ajm-detail-table tr:last-child td {
    border-bottom: none;
}

/* Apply button on single job */
.ajm-apply-section {
    margin-top: 30px;
    padding: 24px;
    background: #eff6ff;
    border-radius: 12px;
    text-align: center;
}

.ajm-apply-section h3 {
    margin: 0 0 10px;
    color: #1e40af;
}

.ajm-apply-section p {
    color: #4b5563;
    margin-bottom: 16px;
}

.ajm-apply-message-field {
    margin-bottom: 16px;
}

.ajm-apply-message-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}

/* External / Global Remote jobs */
.ajm-job-external {
    border-left: 3px solid #8b5cf6;
}

.ajm-badge-global {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff !important;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.ajm-job-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ajm-job-company-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ajm-job-company-row .ajm-job-company {
    margin: 0;
}

.ajm-company-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: #f3f4f6;
}

.ajm-btn-external {
    background: #7c3aed;
    color: #fff;
}

.ajm-btn-external:hover {
    background: #6d28d9;
    color: #fff;
}

.ajm-external-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #5b21b6;
}

.ajm-apply-external {
    background: #f5f3ff;
}

.ajm-apply-external h3 {
    color: #5b21b6;
}

.ajm-external-source-note {
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
}

/* Translation / Bilingual display */
.ajm-original-title {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 6px;
    font-style: italic;
}

.ajm-translated-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
}

.ajm-original-content-section {
    margin: 20px 0;
}

.ajm-original-content-section details {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.ajm-original-content-section summary {
    padding: 12px 16px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    user-select: none;
}

.ajm-original-content-section summary:hover {
    background: #f3f4f6;
}

.ajm-original-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
    .ajm-form-row {
        flex-direction: column;
        gap: 0;
    }

    .ajm-role-selector {
        grid-template-columns: 1fr;
    }

    .ajm-budget-fields {
        flex-wrap: wrap;
    }

    .ajm-applicant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ajm-application-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ajm-job-meta,
    .ajm-application-meta,
    .ajm-applicant-meta,
    .ajm-dashboard-job-meta {
        flex-direction: column;
        gap: 4px;
    }
}
