* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.section h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.btn-new-domain {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
    white-space: nowrap;
}

.btn-new-domain:hover {
    background: #5568d3;
}

.modal-input-group {
    margin: 20px 0;
}

.modal-input-group .domain-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.modal-input-group .domain-input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Select All */
.select-all-container {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #667eea;
}

.select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Domain List */
.domain-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.domain-list::-webkit-scrollbar {
    width: 6px;
}

.domain-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.domain-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.domain-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.domain-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #ddd;
    transition: all 0.2s;
}

.domain-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.domain-item input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.domain-item label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
}

.domain-item .domain-info {
    color: #666;
    font-size: 0.9em;
    margin-left: 10px;
}

.domain-item .domain-actions {
    display: flex;
    gap: 10px;
}

.domain-item button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    min-width: 60px;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
    font-weight: 500;
}

.domain-item .btn-detail {
    background: #667eea;
    color: white;
    width: 60px;
    text-align: center;
}

.domain-item .btn-detail:hover,
.domain-item .btn-detail:active,
.domain-item .btn-detail:focus {
    background: #5568d3;
    color: white;
}

.domain-item .btn-delete {
    background: #e74c3c;
    color: white;
    width: 60px;
    text-align: center;
}

.domain-item .btn-delete:hover,
.domain-item .btn-delete:active,
.domain-item .btn-delete:focus {
    background: #c0392b;
    color: white;
}

/* Add Domain Form */
.add-domain-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.domain-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.domain-input:focus {
    outline: none;
    border-color: #667eea;
}

.hint {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.hint-inline {
    display: block;
    color: #888;
    font-size: 0.8em;
    font-weight: normal;
    margin-top: 2px;
}

/* Settings */
.settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-group label {
    min-width: 100px;
    font-weight: 500;
}

.model-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.selected-list {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-domain-tag {
    display: inline-block;
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
}

.selected-list .empty {
    color: #999;
    font-style: italic;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.number-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2em;
}

/* Results */
.results-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.idea-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.idea-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.idea-card .description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.idea-card .elements-used {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.element-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.85em;
    color: #555;
}

.idea-card .uniqueness {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9em;
}

.stars {
    color: #f39c12;
}

/* Idea Header with Favorite Button */
.idea-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.idea-header h3 {
    margin: 0;
    flex: 1;
}

.idea-title {
    cursor: pointer;
    transition: color 0.2s ease;
}

.idea-title:hover {
    color: #5568d3;
}

.idea-actions {
    display: flex;
    gap: 5px;
}

.btn-detail {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    padding: 0 5px;
    color: #999;
    transition: color 0.2s ease, transform 0.2s ease;
}

.btn-detail:hover {
    color: #667eea;
    transform: scale(1.1);
}

.btn-copy {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    padding: 0 5px;
    color: #999;
    transition: color 0.2s ease, transform 0.2s ease;
}

.btn-copy:hover {
    color: #333;
    transform: scale(1.1);
}

.btn-favorite {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 5px;
    color: #ccc;
    transition: color 0.2s ease, transform 0.2s ease;
}

.btn-favorite:hover {
    color: #f39c12;
    transform: scale(1.2);
}

.btn-favorite.favorited {
    color: #f39c12;
}

/* Favorite Card */
.favorite-card {
    border-left-color: #f39c12;
}

.favorite-date {
    margin-top: 10px;
    font-size: 0.8em;
    color: #999;
    text-align: right;
}

/* Elements Preview */
.elements-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.domain-elements {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.domain-elements h3 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Accordion */
.accordion-item {
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
    font-size: 1em;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-title {
    font-weight: 600;
    color: #667eea;
    flex: 1;
}

.accordion-count {
    color: #666;
    font-size: 0.9em;
    margin-right: 10px;
}

.accordion-icon {
    color: #667eea;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.accordion-content {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.category-elements {
    margin-left: 20px;
    margin-bottom: 10px;
}

.category-elements .category-name {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.category-elements .element-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Loading */
.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c33;
}

.success {
    background: #efe;
    color: #3c3;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #3c3;
}

/* Progress */
.progress-container {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.2em;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #f0f0f0;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.9em;
}

.progress-message {
    color: #666;
    font-size: 0.95em;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 30px;
    border-bottom: 2px solid #eee;
    background: #f9f9f9;
}

.modal-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 1.5em;
    flex: 1;
    padding-right: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 25px 30px;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.modal-section p {
    color: #666;
    line-height: 1.8;
    font-size: 1em;
}

.modal-elements {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-element {
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.modal-element strong {
    color: #333;
    font-size: 1em;
}

.modal-element .element-category {
    color: #999;
    font-size: 0.9em;
    margin-left: 8px;
}

.modal-uniqueness {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
}

.modal-list {
    list-style: none;
    padding: 0;
}

.modal-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    color: #666;
    line-height: 1.6;
    border-left: 3px solid #667eea;
}

.modal-list li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    margin-right: 10px;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.95em;
    }

    /* Section header */
    .section-header {
        flex-direction: row;
        gap: 10px;
    }

    .section-header h2 {
        font-size: 1.2em;
    }

    .btn-new-domain {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    /* Domain list */
    .domain-list {
        max-height: 300px;
    }

    .domain-item {
        padding: 10px;
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 10px;
    }

    .domain-item input[type="checkbox"] {
        margin-right: 0;
        margin-top: 5px;
        flex-shrink: 0;
    }

    .domain-item label {
        flex: 1;
        min-width: 0;
        margin-bottom: 0;
    }

    .domain-item .domain-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex-shrink: 0;
    }

    .domain-item button {
        padding: 6px 10px !important;
        font-size: 0.85em !important;
        min-width: 55px !important;
        width: 55px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        flex-shrink: 0 !important;
        text-align: center !important;
    }

    /* Settings */
    .settings {
        gap: 15px;
    }

    .setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setting-group label {
        min-width: auto;
        width: 100%;
    }

    .model-select,
    .selected-list {
        width: 100%;
    }

    /* Buttons */
    .btn-large {
        padding: 12px 30px;
        font-size: 1.1em;
        width: 100%;
    }

    /* Idea cards */
    .idea-card {
        padding: 15px;
    }

    .idea-card h3 {
        font-size: 1.1em;
    }

    .idea-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .idea-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }

    .btn-detail,
    .btn-copy,
    .btn-favorite {
        font-size: 1.5em;
    }

    /* Modal */
    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-section h3 {
        font-size: 1.1em;
    }

    .modal-section p {
        font-size: 0.95em;
    }

    /* Accordion */
    .accordion-header {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .accordion-title {
        font-size: 0.95em;
    }

    .accordion-count {
        font-size: 0.85em;
    }

    /* Element tags */
    .element-tag {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    /* Progress */
    .progress-container {
        padding: 15px;
    }

    .progress-header h3 {
        font-size: 1em;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    .idea-card {
        padding: 12px;
    }

    .idea-card h3 {
        font-size: 1em;
    }

    .modal-header h2 {
        font-size: 1.1em;
    }

    .btn-detail,
    .btn-copy,
    .btn-favorite {
        font-size: 1.3em;
    }
}

