/**
 * Therapeuten Self-Management Interface Styles
 * Modern, professional design using Foundation 6.9
 * Brand color: #009a4e (IFS Green)
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --brand-primary: #009a4e;
    --brand-primary-dark: #007a3e;
    --brand-primary-light: #00b45c;
    --brand-primary-pale: #e8f5ed;

    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Login Screen Styles
   ============================================ */
.therapeuten-login-wrapper {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--brand-primary-pale) 100%);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.therapeuten-login-wrapper .grid-container {
    max-width: 1200px;
    width: 100%;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 540px;
    width: 100%;
    animation: fadeInUp var(--transition-slow);
}

@media screen and (max-width: 639px) {
    .login-card {
        max-width: 100%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    color: var(--color-white);
    box-shadow: 0 8px 16px rgba(0, 154, 78, 0.25);
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--color-gray-600);
    line-height: 1.6;
    margin-bottom: 0;
}

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

.login-form .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}

.login-form .input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    background: var(--color-white);
}

.login-form .input-group:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-pale);
}

.login-form .input-group-label {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--color-gray-50);
    border-right: 1px solid var(--color-gray-200);
    color: var(--color-gray-500);
}

.login-form .input-group-field {
    flex: 1;
    border: none;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    margin: 0;
    background: transparent;
}

.login-form .input-group-field:focus {
    outline: none;
    box-shadow: none;
}

.login-button {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 154, 78, 0.25);
    margin-top: 0.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 154, 78, 0.35);
}

.login-button:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-200);
}

.forgot-password-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.forgot-password-link:hover {
    color: var(--brand-primary-dark);
    gap: 0.75rem;
}

.forgot-password-link svg {
    transition: transform var(--transition-fast);
}

.forgot-password-link:hover svg {
    transform: scale(1.1);
}

/* ============================================
   Profile Management Styles
   ============================================ */
.therapeuten-profile-wrapper,
.therapeuten-edit-profile {
    padding: 2rem 0 4rem;
    background: var(--color-gray-50);
    min-height: 100vh;
}

.profile-header-section {
    background: var(--color-white);
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.profile-main-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.profile-subtitle {
    font-size: 1rem;
    color: var(--color-gray-600);
    margin-bottom: 0;
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.button-group .button {
    margin: 0;
}

/* Profile Cards */
.profile-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--color-gray-200);
    height: calc(100% - 1.5rem);
}

.profile-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: var(--color-white);
}

.profile-card-header svg {
    flex-shrink: 0;
}

.profile-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.0125em;
}

.profile-card-body {
    padding: 1.5rem;
}

/* Profile Fields */
.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--color-gray-100);
}

.profile-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-600);
    flex-shrink: 0;
    margin-right: 1rem;
}

.field-value {
    font-size: 0.9375rem;
    color: var(--color-gray-900);
    text-align: right;
    word-break: break-word;
}

.profile-field-full {
    margin-bottom: 1.5rem;
}

.profile-field-full .field-label {
    display: block;
    margin-bottom: 0.5rem;
}

.field-value-text {
    font-size: 0.9375rem;
    color: var(--color-gray-700);
    line-height: 1.6;
    margin: 0;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--brand-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    word-break: break-all;
}

.profile-link:hover {
    color: var(--brand-primary-dark);
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all var(--transition-fast);
}

.badge.success {
    background: var(--brand-primary-pale);
    color: var(--brand-primary-dark);
}

.language-badges,
.qualification-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.language-badges .badge,
.qualification-badges .badge {
    margin: 0;
}

/* Flash Messages */
.callout {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    position: relative;
}

.callout.warning {
    background: #fffbeb;
    border-color: var(--color-warning);
    color: #92400e;
}

.callout.success {
    background: #f0fdf4;
    border-color: var(--color-success);
    color: #065f46;
}

.callout.alert {
    background: #fef2f2;
    border-color: var(--color-error);
    color: #991b1b;
}

.callout h5 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.callout p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.close-button:hover {
    opacity: 1;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}

.form-control,
.therapeuten-edit-profile-wrapper input[type="text"],
.therapeuten-edit-profile-wrapper input[type="email"],
.therapeuten-edit-profile-wrapper input[type="tel"],
.therapeuten-edit-profile-wrapper input[type="url"],
.therapeuten-edit-profile-wrapper textarea,
.therapeuten-edit-profile-wrapper select,
.therapeuten-profile-wrapper input[type="password"],
.therapeuten-profile-wrapper input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    background: var(--color-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-pale);
}

.form-control::placeholder {
    color: var(--color-gray-400);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
    margin-bottom: 0.5rem;
}

.checkbox-group:hover {
    background: var(--color-gray-50);
}

.checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-gray-700);
    cursor: pointer;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    margin-bottom: 0;
}

.button svg {
    flex-shrink: 0;
}

.tx-therapeutenliste .button.primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 154, 78, 0.25);
}

.tx-therapeutenliste .button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 154, 78, 0.35);
    color: var(--color-white);
}

.tx-therapeutenliste .button.secondary {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    border: 2px solid var(--color-gray-200);
}

.tx-therapeutenliste .button.secondary:hover {
    background: var(--color-gray-200);
    border-color: var(--color-gray-300);
    color: var(--color-gray-800);
}

.button.expanded {
    width: 100%;
    justify-content: center;
}

.form-actions {
    margin-top: 2rem;
}

/* Edit Profile Form Sections */
.therapeuten-edit-profile-wrapper {
    padding: 2rem 0 4rem;
    background: var(--color-gray-50);
    min-height: 100vh;
}

.form-section {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--color-gray-200);
    transition: all var(--transition-base);
}

.form-section:hover {
    box-shadow: var(--shadow-lg);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--brand-primary);
}

.form-section-header svg {
    color: var(--brand-primary);
    flex-shrink: 0;
}

.form-section-header h3,
.form-section h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin: 0;
    letter-spacing: -0.025em;
}

/* Checkbox Grid for Multiple Columns */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Form Text Helper */
.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
    font-style: italic;
}

/* Required Field Indicator */
.required {
    color: var(--color-error);
    font-weight: 600;
}

.required-note {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin: 0;
}

/* Form Actions Bar */
.form-actions-bar {
    background: var(--color-white);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--brand-primary);
    margin-top: 2rem;
}

/* Responsive Adjustments */
@media screen and (max-width: 639px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .profile-header-section .grid-x {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .profile-header-section .button-group {
        width: 100%;
        margin-top: 1rem;
    }

    .profile-header-section .button {
        flex: 1;
    }

    .profile-main-title {
        font-size: 1.75rem;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group .button {
        width: 100%;
        justify-content: center;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .field-value {
        text-align: left;
        margin-top: 0.25rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .form-actions-bar {
        padding: 1rem;
    }

    .form-actions-bar .grid-x {
        flex-direction: column;
    }

    .form-actions-bar .cell {
        width: 100%;
        margin-bottom: 1rem;
    }

    .form-actions-bar .cell:last-child {
        margin-bottom: 0;
    }

    .form-actions-bar .button-group {
        width: 100%;
    }
}

@media screen and (min-width: 640px) and (max-width: 1023px) {
    .profile-main-title {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.profile-card {
    animation: slideInRight var(--transition-slow);
    animation-fill-mode: both;
}

.profile-card:nth-child(1) { animation-delay: 0ms; }
.profile-card:nth-child(2) { animation-delay: 50ms; }
.profile-card:nth-child(3) { animation-delay: 100ms; }
.profile-card:nth-child(4) { animation-delay: 150ms; }
.profile-card:nth-child(5) { animation-delay: 200ms; }
.profile-card:nth-child(6) { animation-delay: 250ms; }

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .button-group,
    .form-actions,
    .login-footer,
    .close-button {
        display: none;
    }

    .profile-card {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        page-break-inside: avoid;
    }
}
