/* css/archives-email.css - Styles for Archives Email functionality */

/* Selection controls */
.archives-selection-controls {
    background: #3a3a5a;
    border-radius: 8px;
}

.selection-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.selection-btn {
    padding: 8px 15px;
    background: #5a5a7a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.selection-btn:hover {
    background: #6a6a8a;
    transform: translateY(-1px);
}

.email-selected-btn {
    padding: 8px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.delete-selected-btn {
    padding: 8px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.email-selected-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.delete-selected-btn:hover {
    background: #4b00b3;
    transform: translateY(-1px);
}

/* Archive card selection */
.archive-selection {
    position: absolute;
    top: 38px;
    right: 10px;
    z-index: 10;
}

.archive-card {
    position: relative;
}

.archive-checkbox {
    display: none;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #4a4a6a;
    border: 2px solid #6a6a8a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: transparent;
    font-size: 14px;
}

.checkbox-label:hover {
    background: #5a5a7a;
    border-color: #007bff;
}

.archive-checkbox:checked + .checkbox-label {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.archive-card.selected {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #2a2a4a 0%, #1a2a4a 100%);
}

/* Email section */
.archives-email-section {
    background: #3a3a5a;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.email-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #4a4a6a;
}

.email-section-header h4 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selection-info {
    color: #e0e0e0;
    font-size: 0.9em;
}

.selection-info span {
    margin-left: 10px;
}

/* Email form */
.email-form-container {
    display: grid;
    gap: 20px;
}

.email-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-form-group label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9em;
}

.email-input, .email-select, .email-textarea {
    padding: 12px;
    border: 2px solid #5a5a7a;
    border-radius: 5px;
    background-color: #4a4a6a;
    color: #ffffff;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.email-input:focus, .email-select:focus, .email-textarea:focus {
    outline: none;
    border-color: #007bff;
    background-color: #5a5a7a;
}

.email-input::placeholder, .email-textarea::placeholder {
    color: #b0b0c0;
}

.email-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Email actions */
.email-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.btn-primary, .btn-secondary, .btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-cancel {
    background: #dc3545;
    color: white;
}

.btn-cancel:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Email result */
.email-result {
    margin-top: 15px;
}

.email-result .success-message {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    font-weight: 600;
    animation: successPulse 0.6s ease-out;
}

.email-result .error-message {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    font-weight: 600;
}

@keyframes successPulse {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .email-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .selection-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selection-btn, .email-selected-btn, .delete-selected-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .email-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary, .btn-secondary, .btn-cancel {
        width: 100%;
        justify-content: center;
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .archive-selection {
        top: 8px;
        right: 8px;
    }
    
    .checkbox-label {
        width: 28px;
        height: 28px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    .archives-selection-controls {
        padding: 20px 15px;
    }
    
    .email-form-container {
        gap: 25px;
    }
}

/* Animation for appearing/disappearing elements */
.archives-email-section {
    animation: slideIn 0.3s ease-out;
}

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

/* Selection counter animation */
.selection-info {
    transition: all 0.3s ease;
}

.selection-info span {
    transition: color 0.3s ease;
}

/* Loading state for send button */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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