@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Noto+Sans+JP:wght@300;400;500;700&family=Playfair+Display:wght@400;700&family=Shippori+Mincho:wght@400;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: #c7d2fe;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: #fbcfe8;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.globe-3 {
    width: 250px;
    height: 250px;
    background: #bae6fd;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(30px, -50px);
    }

    66% {
        transform: translate(-20px, 20px);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    /* Prevent wrapping */
}

.subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Form Styles */
.input-section {
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.input-section:hover {
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.badge {
    font-size: 0.7rem;
    background: #fee2e2;
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.color-picker-container {
    display: flex;
    align-items: center;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Button */
.button-group {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.primary-btn {
    flex: 2;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    flex: 1;
    padding: 14px;
    background: white;
    color: var(--text-color);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.secondary-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.secondary-btn.hidden {
    display: none;
}


.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

.loader.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Area */
.result-container {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
}

.empty-state {
    color: var(--text-light);
    text-align: center;
    border: 2px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.4);
}

.placeholder-content .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.generated-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Card Design Styles (10 Variations) --- */
.generated-card-base {
    width: 100%;
    max-width: 750px;
    aspect-ratio: 91 / 55;
    height: auto;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.generated-card-base:hover {
    transform: translateY(-5px);
}

.card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    opacity: 0.8;
    z-index: 2;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 0.05em;
    z-index: 2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 10px;
}

.card-title {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.card-watermark {
    display: none;
}

/* Styles 1-10 (Simplified for updating) */
.card-style-1 {
    background: #fdfbf7;
    color: #4b5563;
}

.card-style-2 {
    background: linear-gradient(to bottom, #0f172a, #1e3a8a);
    color: #f0f9ff;
}

.card-style-3 {
    background: linear-gradient(135deg, #4c1d95, #be185d, #fbbf24);
    color: #fff;
}

.card-style-4 {
    background: linear-gradient(to bottom right, #14532d, #166534, #15803d);
    color: #dcfce7;
}

.card-style-5 {
    background: linear-gradient(120deg, #fdf2f8, #fce7f3);
    color: #9d174d;
}

.card-style-6 {
    background: linear-gradient(to right, #000000, #111827);
    color: #fff;
}

.card-style-7 {
    background: linear-gradient(to bottom right, #d6d3d1, #a8a29e);
    color: #44403c;
}

.card-style-8 {
    background: radial-gradient(ellipse at bottom, #1B2735, #090A0F);
    color: #e2e8f0;
}

.card-style-9 {
    background: linear-gradient(180deg, #e0f2fe, #bae6fd);
    color: #0369a1;
}

.card-style-10 {
    background: linear-gradient(to top right, #e9d5ff, #c084fc);
    color: #581c87;
}

.card-description {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

/* Specific Layout Implementation (Dynamic Variations) */
.generated-card-layout {
    width: 100%;
    max-width: 750px;
    /* 1.5x Size */
    aspect-ratio: 91 / 55;
    background: white;
    color: #333;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    font-family: 'Noto Sans JP', serif;
    animation: fadeUp 0.6s ease-out;
    --accent-color: #ffd700;
}

/* Layout Variations (1-10) */
.layout-variation-1 {
    background: linear-gradient(15deg, var(--accent-color) 35%, white 35.5%);
}

.layout-variation-2 {
    background: linear-gradient(to left, var(--accent-color) 15%, white 15%);
}

.layout-variation-3 {
    background: linear-gradient(to top, var(--accent-color) 20%, white 20%);
}

.layout-variation-4 {
    background: linear-gradient(135deg, var(--accent-color) 25%, white 25.5%);
}

.layout-variation-5 {
    background: linear-gradient(to right, white 40%, var(--accent-color) 40%, var(--accent-color) 45%, white 45%);
}

.layout-variation-6 {
    background: linear-gradient(45deg, white 40%, var(--accent-color) 40%, var(--accent-color) 60%, white 60%);
}

.layout-variation-7 {
    background: radial-gradient(circle at 100% 100%, var(--accent-color) 40%, white 40.5%);
}

.layout-variation-8 {
    background: linear-gradient(to right, var(--accent-color) 10%, white 10%);
}

.layout-variation-9 {
    background: linear-gradient(45deg, var(--accent-color) 25%, transparent 25%), linear-gradient(-45deg, var(--accent-color) 25%, transparent 25%);
    background-color: white;
}

.layout-variation-10 {
    background: linear-gradient(to bottom, var(--accent-color) 10%, white 10%);
}

/* Left Content Area */
.layout-left {
    position: absolute;
    top: 15%;
    left: 8%;
    width: 65%;
    z-index: 10;
}

.layout-name-main,
.layout-contact,
.layout-role {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.layout-role {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.layout-name-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.layout-name-main {
    font-size: 1.8rem;
    font-weight: 500;
    margin-right: 1rem;
    letter-spacing: 0.1em;
    font-family: 'Shippori Mincho', serif;
}

.layout-contact {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #444;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

/* Right Content Area (Vertical Text) */
.layout-right {
    position: absolute;
    top: 20%;
    right: 8%;
    height: 60%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10;
}

.layout-company {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1.3rem;
    font-family: 'Shippori Mincho', serif;
    letter-spacing: 0.2em;
    color: #333;
    height: 100%;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    z-index: 20;
}

.layout-company.long-company-name {
    font-size: 1.0rem;
    line-height: 1.2;
    white-space: normal;
    width: 2em;
}

.layout-bottom {
    display: none;
}


/* --------------------------------------------------------- */
/*                   PRINT HELPER                            */
/* --------------------------------------------------------- */

/* Helper for the print container in case it's visible */
.print-card-wrapper {
    padding: 2mm;
    display: flex;
    justify-content: center;
}