/* Mom Template Generator Frontend Styles */
.mtg-generator-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mtg-generator-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.mtg-generator-card h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form Styles */
.mtg-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

.mtg-textarea {
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
    min-height: 100px;
}

.mtg-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.mtg-select {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.mtg-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Button Styles */
.mtg-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mtg-button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.mtg-button-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f639a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.mtg-button:not(.mtg-button-primary) {
    background: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
}

.mtg-button:not(.mtg-button-primary):hover {
    background: #d5dbdb;
    border-color: #95a5a6;
}

/* Loading States */
.mtg-loading {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Result Styles */
.mtg-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e8f5e8, #f0f8e8);
    border-radius: 12px;
    border: 2px solid #27ae60;
    text-align: center;
}

.mtg-result h4 {
    color: #27ae60;
    margin-bottom: 1rem;
    font-size: 1.3em;
}

.mtg-preview {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e8ed;
}

.mtg-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Template Library Styles */
.mtg-library-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
}

.mtg-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.mtg-template-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.mtg-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.template-preview {
    height: 120px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

.template-icon {
    font-size: 2.5rem;
}

.mtg-template-card h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.template-type {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.mtg-use-template {
    width: 100%;
    background: #3498db;
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 600;
}

.mtg-use-template:hover {
    background: #2980b9;
}

/* Simple Template Result */
.mtg-simple-result {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin: 1rem 0;
}

/* Provider Badge */
.provider-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
}

/* Success/Error Messages */
.mtg-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.mtg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mtg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mtg-generator-wrapper {
        margin: 1rem;
    }

    .mtg-generator-card {
        padding: 1.5rem;
    }

    .mtg-actions {
        flex-direction: column;
    }

    .mtg-library-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Submitting State */
.mtg-form.submitting {
    opacity: 0.7;
    pointer-events: none;
}