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

body {
    font-family: 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    text-align: center;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1em;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

button {
    flex: 1;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

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

.load-example-btn {
    background: #f0f0f0;
    color: #333;
}

.load-example-btn:hover {
    background: #e0e0e0;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-size: 1.2em;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    display: none;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: #c33;
}

.error.active {
    display: block;
}

.results {
    display: none;
}

.results.active {
    display: block;
}

.results h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.image-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
    position: relative;
}

.image-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-card img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.image-card img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.image-title {
    color: #333;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    font-size: 0.9em;
}

.svg-hint {
    text-align: center;
    color: #666;
    font-size: 0.8em;
    margin-top: 5px;
    font-style: italic;
}

.download-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.download-btn {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85em;
    transition: background 0.3s;
}

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

.download-btn.svg {
    background: #28a745;
}

.download-btn.svg:hover {
    background: #218838;
}

.markdown-download {
    text-align: center;
    margin-bottom: 20px;
}

.download-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.markdown-preview {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.markdown-preview h2 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.markdown-preview h3 {
    color: #555;
    margin-top: 15px;
    margin-bottom: 8px;
}

.markdown-preview hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 20px 0;
}

.google-sheets-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 2px solid #e0e0e0;
}

.google-sheets-section h2 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 16px;
}

.sheets-form {
    display: grid;
    gap: 16px;
}

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

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input, .form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    background: white;
    cursor: pointer;
}

.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.fetch-btn, .load-weeks-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 8px;
}

.load-weeks-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.fetch-btn:hover, .load-weeks-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.fetch-btn:disabled, .load-weeks-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.week-selector-group {
    display: none;
}

.week-selector-group.active {
    display: block;
}

.divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    color: #999;
    font-weight: 600;
}

.info-text {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}