/* ai-writer-改-style.css */

/* --- General Layout --- */
.tool-header {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--white-color);
    border-bottom: 1px solid var(--border-color);
}

.tool-header h1 {
    margin: 0;
    font-size: 32px;
}

.tool-container {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 40px auto;
    position: relative;
}

.step-container {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.step-title {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}


/* --- Step 1: Input Area --- */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.input-group input {
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
}

.tool-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 500;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.tool-btn:hover:not(:disabled) {
    background-color: var(--primary-color-dark);
}

.tool-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* --- Step 2: Headline Selection --- */
#headline-options-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.radio-option {
    display: block;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
}

.radio-option label {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked+label {
    background-color: #e9f5ff;
    border-color: var(--primary-color);
    font-weight: bold;
}

/* --- Step 3: Outline Display & Edit --- */
.outline-list-editor {
    background-color: var(--bg-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    min-height: 200px;
    cursor: text;
}

.outline-list-editor:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

.outline-list-editor ul {
    padding-left: 20px;
    margin: 0;
}

.outline-list-editor li {
    line-height: 1.8;
}


/* --- Step 4: Final Article --- */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header .step-title {
    border: none;
    margin-bottom: 0;
}

.copy-btn {
    background-color: #28a745;
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #218838;
}

.final-article-wrapper {
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.final-title {
    font-size: 28px;
    margin: 0 0 20px 0;
}

.result-output {
    min-height: 500px;
    line-height: 1.8;
    outline: none;
}

.result-output h2 {
    font-size: 22px;
    margin: 40px 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.result-output h3 {
    font-size: 18px;
    margin: 30px 0 15px 0;
    padding-left: 10px;
    border-left: 4px solid var(--primary-color);
}

.result-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.result-output th,
.result-output td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

.result-output th {
    background-color: var(--bg-color);
    font-weight: bold;
}

.result-output mark {
    background-color: #fff3cd;
    /* 黄色いマーカー風 */
    padding: 0.2em;
    border-radius: 3px;
}


/* --- Loading Spinner --- */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--light-text-color);
}

.writer-character {
    position: relative;
    width: 150px;
    height: 100px;
    margin-bottom: 15px;
}

.pencil {
    width: 20px;
    height: 80px;
    position: absolute;
    left: 50%;
    top: 0;
    transform-origin: bottom center;
    animation: write 1.5s cubic-bezier(0.645, 0.045, 0.355, 1.000) infinite;
}

.pencil-body {
    height: 65px;
    background-color: #f1c40f;
    /* Yellow */
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border: 2px solid #34495e;
    border-bottom: none;
    box-sizing: border-box;
}

.pencil-tip {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 15px solid #34495e;
    /* Dark tip */
    margin: 0 auto;
}

.paper {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    position: absolute;
    bottom: 0;
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.paper::after {
    content: '';
    position: absolute;
    left: 10%;
    bottom: 3px;
    width: 0;
    height: 2px;
    background-color: #7f8c8d;
    animation: draw-line 1.5s cubic-bezier(0.645, 0.045, 0.355, 1.000) infinite;
}

@keyframes write {

    0%,
    100% {
        transform: translateX(-50%) translateY(0) rotate(-30deg);
    }

    25% {
        transform: translateX(-60%) translateY(-10px) rotate(-35deg);
    }

    50% {
        transform: translateX(-40%) translateY(0) rotate(-25deg);
    }

    75% {
        transform: translateX(-50%) translateY(-5px) rotate(-30deg);
    }
}

@keyframes draw-line {
    0% {
        width: 0;
        left: 10%;
    }

    50% {
        width: 60%;
        left: 20%;
    }

    100% {
        width: 0;
        left: 80%;
    }
}


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