/* Base styles */
body {
    padding-top: 70px;
    padding-bottom: 2em;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at top left, #e7f0fa, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2c3e50;
}

/* Navigation */
#ipac-nav-wrapper {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-sizing: border-box;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 12px 0;
}

#ipac-nav button {
    position: relative;
    padding: 12px 8px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    font-weight: 600;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Card styles */
.card {
    background: #ffffff;    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 2em 2em 2.5em;
    width: 100%;
    max-width: 880px;
    margin: 20px 0 2.5em;
    transition: transform 0.3s ease;
    overflow: visible !important;
}

.card:hover {
    transform: translateY(-2px);
}

/* Typography */
h2 {
    font-weight: 600;
    font-size: 1.9em;
    background: linear-gradient(to right, #4f8cf1, #00bcd4);
    color: rgb(12, 12, 12);
    padding: 0.5em 1em;
    border-radius: 12px;
    margin-bottom: 0.4em;
}

h2 .zh {
    display: block;
    font-size: 0.9em;
    font-weight: normal;
    color: #151616;
}

h3 {
    margin-bottom: 0.5em;
    color: #34495e;
}

.zh {
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.95em;
    color: #120f0f;
}

/* Form elements */
label, 
select, 
textarea, 
button {
    width: 100%;
    font-size: 1em;
    padding: 12px;
    border-radius: 10px;
    margin-top: 12px;
    border: 1px solid #ccc;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05);
}

select {
    background-color: #f4faff;
}

button {
    background: linear-gradient(to right, #4f8cf1, #00bcd4);
    color: white;
    font-weight: 600;
    border: none;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Input elements */
textarea {
    background-color: #fcfcfc;
    resize: vertical;
    min-height: 150px;
}

/* Template section */
.template-section {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    margin-top: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Output section */
#output {
    white-space: pre-wrap;
    font-family: 'Poppins', monospace;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Progress section */
.progress-container {
    width: 100%;
    max-width: 880px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #4f8cf1, #00bcd4);
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8em;
    color: #6c757d;
}

/* Choices.js custom styling */
.choices {
    margin-bottom: 15px;
}

.choices__inner {
    background-color: #f4faff;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05);
}

.choices__list--dropdown {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Information sections */
.info-section {
    margin-top: 24px;
}

.info-section p {
    margin-bottom: 0.6em;
}

.label {
    font-weight: 600;
    margin-top: 1em;
    display: block;
}

.scaffold {
    background-color: #f0f7ff;
    padding: 1em;
    border-left: 5px solid #4f8cf1;
    border-radius: 10px;
    margin-top: 15px;
    font-style: italic;
}

/* Search interface */
.search-container {
    margin-bottom: 15px;
}

.search-options {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-options label {
    width: auto;
    padding: 5px 10px;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.search-options input[type="checkbox"] {
    margin: 0;
}

/* Panel sections */
#panel-issue, 
#panel-principle, 
#panel-application, 
#panel-conclusion {
    scroll-margin-top: 80px;
}

#panel-application {
    border-left: 6px solid #00b894;
}

#panel-application h2 {
    background: linear-gradient(to right, #00b894, #55efc4);
    color: white;
}

#panel-conclusion {
    border-left: 6px solid #6c5ce7;
}

#panel-conclusion h2 {
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    color: white;
}

#panel-preview {
    border-left: 6px solid #9b59b6;
}

#panel-preview h2 {
    background: linear-gradient(to right, #9b59b6, #af7ac5);
    color: white;
}

/* Navigation */
#ipac-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
}

/* Navigation button styles */
#ipac-nav button {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#ipac-nav button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#ipac-nav button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#ipac-nav button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

#ipac-nav button:hover::after {
    transform: scaleX(1);
}

#ipac-nav .zh {
    display: block;
    font-size: 0.75em;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    opacity: 0.9;
    margin-top: 4px;
}

#ipac-nav button.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

#ipac-nav button.active::after {
    transform: scaleX(1);
    height: 4px;
}

/* Tooltip styles */
#tooltip {
    position: fixed;
    max-width: 350px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 14px;
    line-height: 1.5;
}

#tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

#tooltip h4 {
    margin: 0 0 10px 0;
    color: #4f8cf1;
    font-size: 16px;
    font-weight: 600;
}

#tooltip .principle {
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

#tooltip .summary {
    color: #666;
    margin-bottom: 10px;
}

#tooltip .chinese {
    color: #888;
    font-style: italic;
    font-size: 13px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

/* Progress styles */
.progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #4f8cf1, #00bcd4);
    transition: width 0.3s ease;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-title {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.8em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Example section styles */
.example-section h3 {
    background-color: #00b894;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.example-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.example-section {
    margin-bottom: 15px;
}

.preview-textarea {
    margin-top: 20px;
    height: 200px;
}

/* Example button styles */
#showExampleBtn {
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 85px auto 20px auto;
}

.example-button-container {
    text-align: center;
    margin: 85px auto 20px auto;
    max-width: 880px;
}

/* Progress container styles */
#progress-container {
    max-width: 880px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 0 1em;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8em;
    color: #6c757d;
}

/* Section styles */
#panel-issue {
    border-left: 6px solid #f5a623;
}

#panel-issue h2 {
    background: linear-gradient(to right, #f5a623, #fdd835);
    color: white;
}

#panel-principle {
    border-left: 6px solid #4f8cf1;
}

#panel-principle h2 {
    background: linear-gradient(to right, #4f8cf1, #00bcd4);
    color: white;
}

#panel-application {
    border-left: 6px solid #00b894;
}

#panel-application h2 {
    background: linear-gradient(to right, #00b894, #55efc4);
    color: white;
}

#panel-conclusion {
    border-left: 6px solid #6c5ce7;
}

#panel-conclusion h2 {
    background: linear-gradient(to right, #6c5ce7, #a29bfe);
    color: white;
}

#panel-preview {
    border-left: 6px solid #9b59b6;
}

#panel-preview h2 {
    background: linear-gradient(to right, #9b59b6, #af7ac5);
    color: white;
}

/* Feedback container styles */
.feedback-container {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.85em;
    color: #6c757d;
}

/* Search container and options */
.search-container {
    margin-bottom: 15px;
}

.search-options {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-options label {
    width: auto;
    padding: 5px 10px;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Case info section */
#caseInfo {
    margin-top: 20px;
}

#caseInfo p {
    margin-bottom: 0.8em;
}

/* Form elements */
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Hide elements */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 60px 15px 2em;
    }

    .card {
        padding: 1.5em;
    }

    h2 {
        font-size: 1.6em;
        padding: 0.4em 0.8em;
    }

    #ipac-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    #tooltip {
        max-width: 300px;
    }
}
