/**
 * Fictioneer Chapter Bulk Downloader Styles
 */

/* Modal Styles */
.fictioneer-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fictioneer-fadeIn 0.3s ease-in-out;
}

@keyframes fictioneer-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fictioneer-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 600px;
    overflow-y: auto;
    animation: fictioneer-slideIn 0.3s ease-in-out;
}

@keyframes fictioneer-slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.fictioneer-modal-content h2 {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.fictioneer-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1;
}

.fictioneer-modal-close:hover,
.fictioneer-modal-close:focus {
    color: #333;
}

/* Modal Body */
.fictioneer-modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.fictioneer-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fictioneer-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Story Info */
.story-info {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.story-info > div {
    margin-bottom: 12px;
}

.story-info > div:last-child {
    margin-bottom: 0;
}

.story-info strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.95rem;
}

.chapter-count span {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.story-description {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.story-description p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
}

/* Modal Footer */
.fictioneer-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Buttons */
.fictioneer-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: none;
    font-family: inherit;
}

.fictioneer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fictioneer-btn-primary {
    background-color: #0073aa;
    color: white;
}

.fictioneer-btn-primary:not(:disabled):hover,
.fictioneer-btn-primary:not(:disabled):focus {
    background-color: #005a87;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.fictioneer-btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.fictioneer-btn-secondary:hover,
.fictioneer-btn-secondary:focus {
    background-color: #d0d0d0;
}

/* Download Button */
.fictioneer-download-chapters-btn {
    display: inline-block;
    margin: 15px 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.fictioneer-download-chapters-btn:hover,
.fictioneer-download-chapters-btn:focus {
    background: linear-gradient(135deg, #005a87 0%, #003d5c 100%);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    transform: translateY(-2px);
}

.fictioneer-download-chapters-btn:active {
    transform: translateY(0);
}

/* Notice Messages */
.fictioneer-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 1000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fictioneer-slideInRight 0.3s ease-in-out;
}

@keyframes fictioneer-slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fictioneer-notice-success {
    background-color: #28a745;
    color: white;
}

.fictioneer-notice-error {
    background-color: #dc3545;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fictioneer-modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .fictioneer-modal-content h2 {
        font-size: 1.2rem;
    }

    .fictioneer-modal-footer {
        flex-direction: column;
    }

    .fictioneer-btn {
        width: 100%;
    }

    .fictioneer-download-chapters-btn {
        width: 100%;
        margin: 10px 0;
    }

    .fictioneer-notice {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .fictioneer-modal-content {
        margin: 30% auto;
        max-width: 100%;
    }

    .fictioneer-modal-close {
        right: 15px;
        top: 10px;
    }

    .fictioneer-modal-body,
    .fictioneer-modal-footer {
        padding: 15px;
    }

    .fictioneer-modal-content h2 {
        padding: 15px;
        font-size: 1.1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .fictioneer-modal {
        background-color: rgba(0, 0, 0, 0.7);
    }

    .fictioneer-modal-content {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    .fictioneer-modal-content h2 {
        color: #e0e0e0;
        border-bottom-color: #444;
    }

    .fictioneer-modal-close {
        color: #999;
    }

    .fictioneer-modal-close:hover,
    .fictioneer-modal-close:focus {
        color: #e0e0e0;
    }

    .form-group label,
    .story-info strong {
        color: #e0e0e0;
    }

    .fictioneer-select {
        background-color: #333;
        border-color: #555;
        color: #e0e0e0;
    }

    .fictioneer-select:focus {
        border-color: #0099ff;
    }

    .story-info {
        background-color: #333;
    }

    .story-description {
        background-color: #2a2a2a;
        border-left-color: #0099ff;
    }

    .story-description p {
        color: #b0b0b0;
    }

    .fictioneer-modal-footer {
        border-top-color: #444;
    }

    .fictioneer-btn-secondary {
        background-color: #444;
        color: #e0e0e0;
    }

    .fictioneer-btn-secondary:hover,
    .fictioneer-btn-secondary:focus {
        background-color: #555;
    }
}
