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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000;
    color: #fff;
    padding: 20px;
    min-height: 100vh;
}

@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
        color: #000;
    }
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
}

@media (prefers-color-scheme: light) {
    .form-section {
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group.inline {
    flex-direction: row;
    align-items: center;
}

.form-group.inline label {
    flex-shrink: 0;
    margin-right: 10px;
}

label {
    font-size: 14px;
    font-weight: 500;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #444;
    border-radius: 6px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
}

@media (prefers-color-scheme: light) {
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="url"],
    select {
        background: #fff;
        color: #000;
        border-color: #999;
    }
}

input[type="color"] {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

input[type="file"] {
    padding: 8px;
    border: 2px solid #444;
    border-radius: 6px;
    background: #2a2a2a;
    color: #fff;
    cursor: pointer;
}

@media (prefers-color-scheme: light) {
    input[type="file"] {
        background: #fff;
        color: #000;
        border-color: #999;
    }
}

.sns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.sns-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 40px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 6px;
}

@media (prefers-color-scheme: light) {
    .sns-item {
        background: #fff;
        border-color: #999;
    }
}

.sns-item img {
    width: 20px;
    height: 20px;
}

.sns-item span {
    flex: 1;
}

.sns-item button {
    padding: 4px 12px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.sns-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.sns-add select {
    flex: 1;
    height: 40px;
}

.sns-add input {
    flex: 2;
    height: 40px;
}

.sns-add button {
    padding: 0 16px;
    height: 40px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.download-btn {
    padding: 14px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
}

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

.preview-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-preview {
    width: 1200px;
    height: 675px;
    position: relative;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.zoom-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 1;
}

.zoom-preview:hover::before {
    opacity: 1;
}

.zoom-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    background-image: url('../assets/icons/dark/expand_content.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
}

.zoom-preview:hover::after {
    opacity: 1;
}

.zoom-preview .tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.zoom-preview:hover .tooltip {
    opacity: 1;
}

@media (prefers-color-scheme: light) {
    .zoom-preview {
        border-color: #ddd;
    }
    
    .zoom-preview::after {
        background-image: url('../assets/icons/light/expand_content.svg');
    }
}

.info-card {
    position: absolute;
    bottom: 50px;
    right: 50px;
    width: 375px;
    min-height: 250px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    gap: 20px;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-name {
    font-size: 30px;
    font-weight: bold;
    color: #000;
}

.preview-subtitle {
    font-size: 17px;
    color: #555;
    margin-bottom: 10px;
}

.preview-contact {
    font-size: 15px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-sns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-sns-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #000;
}

.preview-sns-item img {
    width: 20px;
    height: 20px;
}

.preview-qr {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.preview-qr img {
    width: 100%;
    height: 100%;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    pointer-events: none;
}

.modal .zoom-preview {
    width: 1920px;
    height: 1080px;
    max-width: 95vw;
    max-height: 95vh;
    cursor: pointer;
    pointer-events: auto;
}

.modal .zoom-preview::before {
    display: block;
}

.modal .zoom-preview::after {
    background-image: url('../assets/icons/dark/collapse_content.svg');
    display: block;
}

@media (prefers-color-scheme: light) {
    .modal .zoom-preview::after {
        background-image: url('../assets/icons/light/collapse_content.svg');
    }
}

.modal .zoom-preview:hover::before {
    opacity: 1;
}

.modal .zoom-preview:hover::after {
    opacity: 1;
}

.modal .info-card {
    bottom: 80px;
    right: 80px;
    width: 600px;
    min-height: 400px;
    padding: 40px;
    gap: 30px;
}

.modal .preview-name {
    font-size: 48px;
}

.modal .preview-subtitle {
    font-size: 28px;
    margin-bottom: 16px;
}

.modal .preview-contact {
    font-size: 24px;
    gap: 12px;
}

.modal .preview-sns-item {
    font-size: 24px;
    gap: 12px;
}

.modal .preview-sns-item img {
    width: 32px;
    height: 32px;
}

.modal .preview-qr {
    width: 140px;
    height: 140px;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    #canvas {
        max-width: 100%;
    }
}
