:root {
    --tamaly-dark-bg: #0F172A;
    --tamaly-bg: #1F2933;
    --tamaly-primary: #3B82F6;
    --tamaly-primary-light: #60A5FA;
    --tamaly-primary-dark: #1D4ED8;
    --tamaly-text: #E5E7EB;
    --tamaly-text-muted: #9CA3AF;
    --tamaly-border: #374151;
    --tamaly-card-bg: #273746;273746
    --tamaly-danger: #EF4444;
    --tamaly-danger-hover: #DC2626;
}

html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--tamaly-bg);
    color: var(--tamaly-text);
    margin: 0;
    font-size: 16px;
}

a {
    color: var(--tamaly-primary-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background-color: var(--tamaly-card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--tamaly-border);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.auth-logo {
    display: block;
    margin: 0 auto 2rem auto;
    width: 150px;
}

.auth-card h2 {
    color: var(--tamaly-text);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

/* --- Layout für das Dashboard (nach Login) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 100vh;
    grid-template-areas: "sidebar main";
}

/* --- Sidebar-Styling --- */
.sidebar {
    grid-area: sidebar;
    background-color: var(--tamaly-dark-bg);
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--tamaly-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000; /* Sidebar über dem Overlay */
    transition: transform 0.3s ease-in-out; /* Für Slide-Effekt */
}

.sidebar-logo {
    width: 150px;
    margin-bottom: 3rem;
    align-self: center;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav a {
    display: block;
    color: var(--tamaly-text);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: var(--tamaly-bg);
}

.sidebar-nav a.active {
    background-color: var(--tamaly-primary);
    font-weight: bold;
}

.sidebar-footer {
    color: var(--tamaly-text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding-top: 1rem;
}

.main-content {
    grid-area: main;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--tamaly-border);
}

.mobile-logo {
    height: 30px;
}

.hamburger-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--tamaly-text);
    border-radius: 3px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.overlay.is-open {
    opacity: 1;
    visibility: visible;
}


.page-header {
    border-bottom: 1px solid var(--tamaly-border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
    color: white;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--tamaly-text-muted);
    font-weight: bold;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--tamaly-dark-bg);
    border: 1px solid var(--tamaly-border);
    border-radius: 8px;
    color: var(--tamaly-text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--tamaly-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--tamaly-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--tamaly-primary-light);
    color: white;
    text-decoration: none;
}

.btn-danger {
    background-color: var(--tamaly-danger-hover);
    color: white;
}

.btn-secondary {
    background-color: var(--tamaly-border);
    color: var(--tamaly-text);
}
.btn-secondary:hover {
    background-color: #4b5563;
    color: white;
    text-decoration: none;
}

.text-center {
    text-align: center;
}


.content-card {
    background-color: var(--tamaly-card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--tamaly-border);
}


.flash-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.flash-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
    color: #A7F3D0;
}

.flash-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--tamaly-danger);
    color: #FECACA;
}

.flash-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--tamaly-primary);
    color: #BFDBFE;
}


@media (max-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
    .dashboard-grid {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
    }

    .main-content {
        padding: 1.5rem;
    }

    .mobile-header {
        display: flex;
    }

    .page-header {
        border: none;
        padding: 0;
        margin: 0 0 1.5rem 0;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        border-right: 1px solid var(--tamaly-border);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .form-grid-2-col,
    .form-grid-3-col {
        grid-template-columns: 1fr;
    }

    .danger-zone-card {
        grid-template-columns: 1fr;
        display: grid;
        gap: 2rem;
    }

}

.profile-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .profile-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.subscription-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

@media (min-width: 768px) {
    .subscription-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

#mjmlPreviewIframe {
    width: 100%;
    height: 600px;
    border: 1px solid var(--tamaly-border);
    background-color: white;
    margin-top: 15px;
    border-radius: 8px;
}

.feedback-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tamaly-border);
}

.refine-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.refine-section input {
    flex-grow: 1;
}

.radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.radio-group .radio-label {
    font-weight: normal;
    color: var(--tamaly-text);
}

.timestamp {
    font-size: 0.8rem;
    color: var(--tamaly-text-muted);
    margin-bottom: 1rem;
    text-align: right;
}

#status-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#status-content {
    background-color: var(--tamaly-card-bg);
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    color: var(--tamaly-text);
    box-shadow: 0 4px 25px rgba(0,0,0,0.4);
    position: relative;
}

.spinner {
    border: 4px solid var(--tamaly-border);
    border-top: 4px solid var(--tamaly-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

.download-button {
    display: inline-block;
    background-color: var(--tamaly-primary);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}
.download-button:hover {
    background-color: var(--tamaly-primary-light);
    text-decoration: none;
}

.close-button {
    display: none;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: var(--tamaly-text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-button:hover {
    color: var(--tamaly-text);
}

.feature-card {
    display: block;
    background-color: var(--tamaly-card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--tamaly-border);
    text-decoration: none;
    color: var(--tamaly-text);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    text-decoration: none;
}

.feature-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feature-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.feature-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin: 0 0 0.5rem 0;
    color: white;
}

.feature-card p {
    color: var(--tamaly-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-card .card-link {
    color: var(--tamaly-primary-light);
    font-weight: bold;
}

.accordion-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.accordion-toggle h2 {
    margin: 0; /* Entfernt Standard-Margin von h2 */
}

.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.accordion-toggle.active .accordion-icon {
    transform: rotate(180deg);
}

.btn-success {
    background-color: #10B981; /* Ein sattes Grün */
    color: white;
    font-weight: bold;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease-in-out;
}

.btn-success:hover {
    background-color: #059669;
}

.feature-card.status-active { border-top: 4px solid #10B981; }
.feature-card.status-creating { border-top: 4px solid #F59E0B; }
.feature-card.status-failed { border-top: 4px solid #EF4444; }

.plan-display {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem; /* NEU: Abstand zum Logo */
    margin-bottom: 1rem;
}

.plan-display-brand {
    display: block;
    font-size: 0.8rem;
    color: var(--tamaly-text-muted);
    letter-spacing: 0.5px;
}

.plan-display-name {
    display: inline-block;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px; /* Pillenform */
    margin-top: 0.5rem;
}

.plan-business {
    background-color: rgba(59, 130, 246, 0.2); /* Heller Blauton */
    color: #60A5FA;
}
.plan-professional {
    background-color: rgba(34, 211, 238, 0.2); /* Heller Türkis-Ton */
    color: #22D3EE;
}
.plan-enterprise {
    background-color: rgba(139, 92, 246, 0.2); /* Heller Violett-Ton */
    color: #A78BFA;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Standardmäßig versteckt */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--tamaly-card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--tamaly-text-muted);
    cursor: pointer;
    border: none;
    background: none;
}

.plan-table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
}
.plan-table th, .plan-table td {
    text-align: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.plan-table th {
    font-size: 1.2rem;
}
.plan-table .feature-name {
    text-align: left;
    font-weight: bold;
}
.plan-table .checkmark {
    color: #10B981; /* Grün */
    font-weight: bold;
}

.modal-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow-y: auto;
}

@media (max-width: 640px) {
  .modal-content {
    padding: 1.5rem 1rem;
  }

  .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

.content-card h2 {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tamaly-border);
}

.plan-switcher {
    display: flex;
    justify-content: center;
    background-color: var(--tamaly-dark-bg);
    border-radius: 9999px;
    padding: 0.25rem;
    margin: 1.5rem auto;
    width: fit-content;
}
.plan-switcher label {
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border-radius: 9999px;
    transition: background-color 0.2s ease-in-out;
    color: var(--tamaly-text-muted);
}
.plan-switcher input[type="radio"] {
    display: none;
}
.plan-switcher input[type="radio"]:checked + span {
    background-color: var(--tamaly-card-bg);
    color: var(--tamaly-text);
    font-weight: bold;
}
