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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

header {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 5px;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

#auth-text {
    font-size: 14px;
    color: #666;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

.form-group {
    margin-bottom: 20px;
}

.inline-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.field-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-group label {
    width: 50px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0;
    flex-shrink: 0;
}

.field-group input {
    flex: 1;
    margin-bottom: 0;
}

.members-section {
    margin-bottom: 15px;
}

.members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.members-label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}

.can-send-checkbox {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    gap: 5px;
    cursor: pointer;
}

.can-send-checkbox input[type="checkbox"] {
    margin: 0;
}

.description-section {
    margin-bottom: 15px;
}

.description-section label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.description-section textarea {
    width: 100%;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    margin-right: 8px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.member-selection {
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    background: #f9f9f9;
}

.search-box {
    margin-bottom: 15px;
}

.member-button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    max-height: none;
}

.member-button {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.member-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.member-button:hover::before {
    left: 100%;
}

.member-button:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.member-button.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.member-button.selected::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.member-button.selected:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.member-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: white;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid #e8e8e8;
}

.member-item:hover {
    background: #f0f0f0;
}

.member-checkbox {
    margin-right: 15px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 12px;
    color: #666;
}

.member-email {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.member-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-role {
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    background: white;
}

.member-send-permission {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.groups-list {
    display: grid;
    gap: 25px;
}

.membership-group {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.membership-header {
    background: #f0f0f0;
    padding: 15px 20px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.membership-icon {
    color: #667eea;
}

.group-count {
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.membership-groups {
    padding: 15px;
    display: grid;
    gap: 15px;
}

.group-item {
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #667eea;
}

.group-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-status-icon {
    cursor: help;
}

.send-all {
    color: #48bb78;
    font-size: 16px;
}

.send-mixed {
    color: #ed8936;
    font-size: 16px;
}

.group-email {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.group-meta {
    font-size: 12px;
    color: #999;
}

.group-members {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}

.member-item-compact {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 8px;
    margin: 2px 3px;
    border-radius: 4px;
    font-size: 12px;
    cursor: help;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.member-item-compact:hover {
    background: #e8e8e8;
}

.no-members {
    color: #999;
    font-style: italic;
}

.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background: #48bb78;
    color: white;
}

.message-error {
    background: #f56565;
    color: white;
}

.message-info {
    background: #4299e1;
    color: white;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.section {
    min-height: 400px;
}

#login-section .card {
    max-width: 500px;
    margin: 50px auto;
    text-align: center;
}

#login-section p {
    margin-bottom: 20px;
    color: #666;
}

.help-text {
    font-size: 11px;
    color: #999;
    margin: 4px 0 4px 58px;
    display: block;
}

.logout-section {
    text-align: center;
    padding: 20px;
}

/* Accordion Styles */
.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
}

.accordion-header {
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px 6px 0 0;
    user-select: none;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-icon {
    font-size: 12px;
    transition: transform 0.2s;
    width: 12px;
    text-align: center;
}

.accordion-content {
    display: none;
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
}

.group-item-compact {
    padding: 8px;
    margin-bottom: 6px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    background: #fafafa;
}

.group-summary {
    font-size: 13px;
    line-height: 1.4;
}

.group-members-compact {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.member-compact {
    display: inline;
    margin-right: 8px;
    font-size: 11px;
}

.send-icon, .send-icon-small {
    margin-right: 5px;
    font-size: 14px;
}

.group-item-small {
    padding: 6px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 8px;
        max-width: 100%;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    h1 {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .inline-fields {
        flex-direction: column;
        gap: 8px;
    }
    
    .field-group {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }
    
    .field-group label {
        width: 42px;
        font-size: 13px;
    }
    
    .field-group input {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .help-text {
        font-size: 10px;
        margin-bottom: 12px;
    }
    
    .members-section {
        margin-bottom: 12px;
    }
    
    .members-header {
        margin-bottom: 8px;
    }
    
    .members-label {
        font-size: 13px;
    }
    
    .can-send-checkbox {
        font-size: 11px;
    }
    
    .member-button-grid {
        gap: 8px;
    }
    
    .member-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .description-section {
        margin-bottom: 12px;
    }
    
    .description-section label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .description-section textarea {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .form-actions {
        flex-direction: column;
        margin-top: 16px;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }
}