/* LINE Rich Menu Creator - Demo Version Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================
   Header & Navigation
   =================== */

header {
    background-color: #06c755;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

header h1 {
    margin-bottom: 15px;
}

.demo-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
    font-weight: normal;
}

nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    border: 2px solid white;
    background-color: transparent;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background-color: white;
    color: #06c755;
}

.nav-btn-curl {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: bold;
}

.nav-btn-curl:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* ===================
   Page Layout
   =================== */

.page {
    display: none;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    color: #06c755;
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

/* ===================
   Buttons
   =================== */

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #06c755;
    color: white;
}

.btn-primary:hover {
    background-color: #05b34b;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-action {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #2196F3;
    color: white;
}

.btn-edit:hover {
    background-color: #1976D2;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #d32f2f;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
    line-height: 1;
    transition: color 0.3s;
}

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

.btn-copy {
    padding: 6px 14px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

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

.btn-copy.copied {
    background-color: #4CAF50;
}

/* ===================
   Messages & States
   =================== */

.hidden {
    display: none !important;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    border-left: 4px solid #2e7d32;
}

.demo-info {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    line-height: 1.8;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.demo-badge {
    display: inline-block;
    background-color: #ff9800;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

/* ===================
   Rich Menu List
   =================== */

.rich-menu-list {
    display: grid;
    gap: 20px;
}

.rich-menu-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.rich-menu-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rich-menu-image {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rich-menu-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

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

.rich-menu-item h3 {
    color: #06c755;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rich-menu-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.rich-menu-info-item {
    display: flex;
    flex-direction: column;
}

.rich-menu-info-item strong {
    color: #666;
    font-size: 12px;
    margin-bottom: 3px;
}

.rich-menu-info-item span {
    color: #333;
}

.rich-menu-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* ===================
   Alias List
   =================== */

.alias-list {
    display: grid;
    gap: 20px;
}

.alias-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s;
    display: flex;
    gap: 20px;
    align-items: center;
}

.alias-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.alias-item .rich-menu-image {
    flex-shrink: 0;
    margin-bottom: 0;
}

.alias-info {
    flex: 1;
}

.alias-info h3 {
    color: #06c755;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.alias-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alias-detail-item {
    display: flex;
    flex-direction: column;
}

.alias-detail-item strong {
    color: #666;
    font-size: 12px;
    margin-bottom: 3px;
}

.alias-detail-item span {
    color: #333;
    font-size: 14px;
}

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

/* ===================
   Form Styles
   =================== */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.form-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #06c755;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #06c755;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

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

.validation-message {
    margin-top: 8px;
    padding: 8px;
    border-radius: 5px;
    font-size: 13px;
}

.validation-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.validation-message.error {
    background-color: #ffebee;
    color: #c62828;
}

/* ===================
   Image Preview
   =================== */

.preview-container {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background-color: #f9f9f9;
    display: inline-block;
    max-width: 100%;
}

#preview-canvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
}

.image-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    font-size: 13px;
    color: #666;
}

/* ===================
   Areas List
   =================== */

.areas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.area-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.area-info {
    flex: 1;
}

.area-info h4 {
    color: #06c755;
    margin-bottom: 5px;
}

.area-info p {
    font-size: 13px;
    color: #666;
    margin: 2px 0;
}

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

/* ===================
   Modal
   =================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #06c755;
    margin-bottom: 20px;
}

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

/* Radio Options */
.action-type-radio {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-option-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s;
}

.radio-option-inline:hover {
    border-color: #06c755;
    background-color: #f5f5f5;
}

.radio-option-inline input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #06c755;
}

.radio-option-inline:has(input[type="radio"]:checked) {
    border-color: #06c755;
    background-color: #e8f5e9;
}

.radio-option-inline span {
    font-size: 14px;
    color: #333;
}

/* ===================
   Curl Modal
   =================== */

.curl-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
}

.curl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.curl-modal-header h3 {
    margin: 0;
}

.sponsor-message {
    text-align: center;
    padding: 20px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 12px;
    border: 2px solid #FFDD00;
}

.sponsor-qr {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.sponsor-qr:hover {
    transform: scale(1.05);
}

.sponsor-text {
    margin: 15px 0 0 0;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    font-weight: 500;
}

.sponsor-hint {
    font-size: 13px;
    color: #666;
    font-weight: normal;
}

.curl-commands-container {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.curl-command-item {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.curl-command-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.curl-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #06c755;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.curl-description {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.curl-note {
    padding: 8px 15px;
    margin: 0;
    font-size: 13px;
    color: #ff9800;
    background-color: #fff8e1;
    border-bottom: 1px solid #e0e0e0;
}

.curl-code {
    margin: 0;
    padding: 15px;
    background-color: #1e1e1e;
    overflow-x: auto;
}

.curl-code code {
    color: #d4d4d4;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

#copy-all-curl {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
}

#copy-all-curl.copied {
    background-color: #4CAF50;
}

/* Scrollbar styling */
.curl-commands-container::-webkit-scrollbar {
    width: 8px;
}

.curl-commands-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.curl-commands-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.curl-commands-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===================
   Responsive
   =================== */

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px;
    }

    nav {
        flex-direction: column;
    }

    .nav-btn-curl {
        margin-left: 0;
    }

    .page {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rich-menu-info {
        grid-template-columns: 1fr;
    }

    .rich-menu-actions {
        flex-wrap: wrap;
    }

    .area-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .alias-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .alias-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Curl modal responsive */
    .curl-modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 0;
    }

    .curl-command-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .curl-step {
        order: 1;
    }

    .curl-description {
        order: 3;
        width: 100%;
    }

    .btn-copy {
        order: 2;
        margin-left: auto;
    }

    .curl-code {
        padding: 10px;
    }

    .curl-code code {
        font-size: 11px;
    }
}
