/*
 * Plugin Name: Custom Job Tool
 * Description: Styles for the Custom Job Tool widget.
 * Version: 2.0.0 (Modernized)
 */

:root {
    /* Integration: Allow easier overriding by themes */
    --cjt-primary-color: #007bff;
    --cjt-primary-hover: #0056b3;
    --cjt-success-color: #28a745;
    --cjt-success-hover: #218838;
    --cjt-bg-color: #f9f9f9;
    --cjt-text-color: #333;
    --cjt-border-color: #ddd;
    --cjt-spacing-unit: 20px;
}

/* Base Reset & Box Model Fix */
#cjt-root {
    box-sizing: border-box;
    max-width: 900px;
    margin: 20px auto;
    padding: var(--cjt-spacing-unit);
    background-color: var(--cjt-bg-color);
    border: 1px solid var(--cjt-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--cjt-text-color);
    font-family: inherit; /* Inherit font from theme */
}

#cjt-root * {
    box-sizing: border-box; /* Fix width:100% + padding issues */
}

/* Job List Styling */
#cjt-root .cjt-job-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#cjt-root .cjt-job-list li {
    background-color: #fff;
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#cjt-root .cjt-job-list li:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

#cjt-root .cjt-job-list a {
    text-decoration: none;
    display: block; /* Make the whole area clickable link */
    color: inherit;
}

.cjt-job-list a:focus {
    outline: 2px solid var(--cjt-primary-color);
    outline-offset: 2px;
}

#cjt-root .cjt-job-list h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--cjt-primary-color);
}

#cjt-root .cjt-job-list p {
    font-size: 0.9em;
    margin: 0;
    color: #666;
}

/* Job Detail Styling */
#cjt-root .cjt-job-detail {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.cjt-job-detail h2 {
    margin-top: 0;
}

.cjt-job-detail .cjt-meta {
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #555;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#cjt-root .cjt-job-detail .cjt-description {
    line-height: 1.6;
}

#cjt-root .cjt-job-detail .cjt-description p {
    margin-bottom: 1em;
}

/* Navigation Buttons */
#cjt-root .cjt-back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: var(--cjt-primary-color);
    color: white !important; /* Force white text on buttons */
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    border: none;
}

.cjt-back-button:hover {
    background-color: var(--cjt-primary-hover);
}

.cjt-back-button:focus {
    outline: 3px solid var(--cjt-primary-hover);
    outline-offset: 2px;
}

/* Application Form Styling */
#cjt-root .cjt-application-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#cjt-root .cjt-application-form input[type="text"],
#cjt-root .cjt-application-form input[type="email"],
#cjt-root .cjt-application-form textarea,
#cjt-root .cjt-application-form input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

#cjt-root .cjt-application-form input:focus,
#cjt-root .cjt-application-form textarea:focus {
    border-color: var(--cjt-primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.cjt-application-form button[type="submit"] {
    background-color: var(--cjt-success-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.cjt-application-form button[type="submit"]:hover {
    background-color: var(--cjt-success-hover);
}

.cjt-application-form button[type="submit"]:focus {
    outline: 3px solid var(--cjt-success-hover);
    outline-offset: 2px;
}

.cjt-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid transparent;
}

.cjt-message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

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

/* Responsive Breakpoints */
@media (max-width: 600px) {
    #cjt-root {
        padding: 15px;
        margin: 10px;
    }

    .cjt-job-detail {
        padding: 15px;
    }

    .cjt-back-button {
        width: 100%;
        text-align: center;
    }

    .cjt-job-list h3 {
        font-size: 1.2rem;
    }
}