﻿/* Organization Modal Styles */
.organization-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.organization-modal.show {
    opacity: 1;
}

.organization-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.organization-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.organization-modal.show .organization-modal-content {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.organization-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.organization-modal-header h2 {
    margin: 0;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.organization-modal-close {
    background: none;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.organization-modal-close:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

/* Modal Body */
.organization-modal-body {
    padding: 2rem;
    max-height: 100vh; /* Doubled from 70vh - now uses full viewport height */
    overflow-y: auto;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Form Rows and Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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

.form-group.required .form-label::after {
    content: " *";
    color: #ef4444;
    font-weight: 600;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1f2937;
    background: white;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.input-validation-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-validation-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.text-danger {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Validation Summary */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.alert ul {
    margin: 0;
    padding-left: 1rem;
}

.alert li {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.alert li:last-child {
    margin-bottom: 0;
}

/* Modal Footer */
.organization-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.btn-primary:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #f8fafc;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Icons */
.icon-plus-circle::before { content: "➕"; }
.icon-x::before { content: "✕"; }
.icon-save::before { content: "💾"; }
.icon-spinner::before { content: "⟳"; }

.icon-spinner.spinning {
    animation: spin 1s linear infinite;
}

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

/* Body modal-open class to prevent background scrolling */
body.modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .organization-modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 10px;
    }

    .organization-modal-header,
    .organization-modal-footer {
        padding: 1rem;
    }

    .organization-modal_body {
        padding: 1rem;
        max-height: 75vh;
    }

    .form-section {
        padding: 1rem;
    }

    .organization-modal-footer {
        flex-direction: column;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .organization-modal-header h2 {
        font-size: 1.25rem;
    }

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

    .organization-modal-footer {
        gap: 0.5rem;
    }
}

/* Notification Styles */
.organization-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.organization-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Custom scrollbar for modal body */
.organization-modal-body::-webkit-scrollbar {
    width: 6px;
}

.organization-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.organization-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.organization-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}