* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: all 0.3s ease;
    background: #000000; /* Set default background */
}

body.light-theme {
    background: #f0f0f0; /* Less bright background */
    color: #111111;
}

body.dark-theme {
    background: #000000;
    color: #ffffff;
}

.email-card {
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 580px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    background: rgba(17, 17, 17, 0.98); /* Set default to dark theme */
}

body.light-theme .email-card {
    background: rgba(255, 255, 255, 0.85); /* More transparent white */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 16px 48px -8px rgba(0, 0, 0, 0.15); /* Added shadow for better depth */
}

body.dark-theme .email-card {
    background: rgba(17, 17, 17, 0.98);
}

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-header i {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

body.light-theme .form-header i {
    color: #111111;
}

body.dark-theme .form-header i {
    color: #ffffff;
}

.form-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

body.light-theme label {
    color: #374151;
}

body.dark-theme label {
    color: #e5e7eb;
}

input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    min-height: auto;
    height: 45px;
}

body.light-theme input {
    background: rgba(255, 255, 255, 0.7); /* More transparent inputs */
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111111;
}

body.dark-theme input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

input:focus {
    outline: none;
}

body.light-theme input:focus {
    border-color: #111111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}

body.dark-theme input:focus {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
}

body.light-theme textarea {
    background: rgba(255, 255, 255, 0.7); /* More transparent inputs */
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111111;
}

body.dark-theme textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

textarea:focus {
    outline: none;
}

body.light-theme textarea:focus {
    border-color: #111111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}

body.dark-theme textarea:focus {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.file-input {
    position: relative;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
    overflow: hidden;
    cursor: pointer;
}

body.light-theme .file-input {
    background: rgba(0, 0, 0, 0.02);
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

body.dark-theme .file-input {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.file-input:hover {
    transform: translateY(-1px);
}

body.light-theme .file-input:hover {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.03);
}

body.dark-theme .file-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.file-input input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.file-label i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

body.light-theme .file-label i {
    color: #111111;
}

body.dark-theme .file-label i {
    color: #ffffff;
}

.file-label span {
    font-size: 0.875rem;
    font-weight: 500;
}

body.light-theme .file-label span {
    color: #374151;
}

body.dark-theme .file-label span {
    color: #e5e7eb;
}

.file-list {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    text-align: left;
}

.file-list div {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
}

.file-list div::before {
    content: "•";
    color: currentColor;
}

body.light-theme .file-list {
    color: #6b7280;
}

body.dark-theme .file-list {
    color: rgba(255, 255, 255, 0.6);
}

/* Update the Browse button styling */
.file-input input[type="file"]::-webkit-file-upload-button {
    visibility: hidden;
}

.file-input input[type="file"]::file-selector-button {
    visibility: hidden;
}

button {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    border: none;
}

body.light-theme button {
    background: #111111;
    color: #ffffff;
}

body.dark-theme button {
    background: #ffffff;
    color: #000000;
}

button:hover {
    transform: translateY(-1px);
}

body.light-theme button:hover {
    background: #000000;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.1);
}

body.dark-theme button:hover {
    background: #f9fafb;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

body.light-theme .theme-toggle {
    background: #111111;
    color: #ffffff;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.1);
}

body.dark-theme .theme-toggle {
    background: #ffffff;
    color: #000000;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.05) rotate(8deg);
}

@media (max-width: 640px) {
    .email-card {
        padding: 1.75rem;
    }
    
    .form-header {
        margin-bottom: 2rem;
    }
    
    .form-header h1 {
        font-size: 1.5rem;
    }
}

.squares-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: auto;
    background: #000000; /* Set default background */
}

/* Add these styles for the message form group specifically */
.form-group.message-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group.message-group textarea {
    min-height: 100px;
    height: 120px;
    padding-bottom: 1rem;
}

/* Add a subtle resize handle indicator */
.form-group.message-group::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    cursor: ns-resize;
    background: 
        linear-gradient(45deg, 
            transparent 50%,
            rgba(128, 128, 128, 0.4) 50%);
    border-radius: 0 0 4px 0;
    pointer-events: none;
}

/* Add these styles */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.preview-content {
    position: relative;
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.preview-header h2 {
    margin: 0;
    color: var(--text-color);
    width: 100%;
    text-align: center;
}

.close-preview {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-preview:hover {
    opacity: 1;
}

.preview-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.preview-field {
    margin-bottom: 1rem;
}

.preview-field label {
    display: block;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.preview-field span {
    color: var(--text-color);
}

.preview-message {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 6px;
    white-space: pre-wrap;
    color: var(--text-color);
}

.preview-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.preview-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.send-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    background: white;
    color: black;
}

.send-btn:hover {
    background: #f0f0f0;
}

/* Dark theme override */
body.dark-theme .send-btn {
    background: #333;
    color: white;
}

body.dark-theme .send-btn:hover {
    background: #444;
}

/* Light theme overrides */
body.light-theme .preview-content {
    --bg-color: #fff;
    --text-color: #000;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .preview-header,
body.light-theme .preview-footer {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .preview-message,
body.light-theme .attachment-item {
    background: rgba(0, 0, 0, 0.05);
}

.status-message {
    margin: 20px auto;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a1a1a;
    max-width: 400px;
    animation: fadeInDown 0.5s ease forwards;
    opacity: 1;
    transition: all 2.5s ease; /* Increased transition duration and smoothed timing */
}

.status-message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10B981;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #EF4444;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.fade-out {
    opacity: 0;
    transform: translateY(-10px); /* Slight upward movement while fading */
}

/* Send Options Styling */
.send-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.send-type-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

body.light-theme .send-type-select {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111111;
}

body.dark-theme .send-type-select {
    background-color: rgba(17, 17, 17, 0.98); /* Match email-card background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .send-type-select:hover {
    background-color: rgba(30, 30, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Style the dropdown options */
body.dark-theme .send-type-select option {
    background-color: rgba(17, 17, 17, 0.98);
    color: #ffffff;
    padding: 8px;
}

body.dark-theme .send-type-select option:hover {
    background-color: rgba(30, 30, 30, 0.98);
}

body.dark-theme .send-type-select:focus {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Preset Options Styling */
.preset-options {
    display: flex;
    gap: 8px;
}

.preset-options button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-theme .preset-options button {
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Add styles for selected state */
body.dark-theme .preset-options button.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

body.dark-theme .preset-options button:hover {
    background: rgba(30, 30, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Light theme styles */
body.light-theme .preset-options button {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111111;
}

body.light-theme .preset-options button.selected {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

body.light-theme .preset-options button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Custom Amount Input Styling */
#customAmount input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

body.light-theme #customAmount input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111111;
}

body.dark-theme #customAmount input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Progress Bar and Animation Styling */
.send-progress {
    margin: 1rem 0 1.5rem 0;
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.send-progress.fade-out {
    opacity: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #10B981;
    width: 0%;
    transition: width 1.2s ease-in-out; /* Slower progress animation */
}

.sending-animation {
    animation: sendingPulse 3s infinite; /* Slower pulse animation */
}

@keyframes sendingPulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Updated Stop Button Styling */
.stop-button {
    width: 28px;
    height: 28px;
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    backdrop-filter: blur(10px);
}

.stop-button i {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.stop-button:hover {
    background: rgba(30, 30, 30, 0.98);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stop-button:hover i {
    color: rgba(255, 255, 255, 1);
}

.stop-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Group for Sending and Preview */
.button-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Updated Preview Button Styling */
.preview-button {
    height: 45px;  /* Match the height of send button */
    width: 45px;   /* Make it square */
    border: none;
    border-radius: 8px;  /* Match send button's border radius */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;  /* Match the theme */
    color: #000000;
    transition: all 0.2s ease;
}

body.light-theme .preview-button {
    background: #111111;
    color: #ffffff;
}

body.dark-theme .preview-button {
    background: #ffffff;
    color: #000000;
}

.preview-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.preview-button i {
    font-size: 18px;  /* Slightly larger icon */
}