* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 60px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
}

.login-box h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
}

/* Card */
.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.info-text {
    color: #666;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f7ff;
    border-left: 4px solid #4285f4;
    border-radius: 4px;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow grid items to shrink below content size */
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    width: 100%; /* Ensure full width within grid cell */
}

.form-group select option {
    font-size: 13px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4285f4;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4285f4;
    color: white;
}

.btn-primary:hover {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f1f3f4;
    color: #333;
}

.btn-secondary:hover {
    background: #e8eaed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 14px 28px;
    font-size: 16px;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    margin-right: 8px;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* TinyMCE Editor */
#email-editor {
    width: 100%;
    min-height: 500px;
}

/* Status Messages */
#send-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
}

#send-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#send-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Live Log Window */
#log-window {
    margin-top: 20px;
    padding: 15px;
    background: #1e1e1e;
    border-radius: 6px;
    border: 1px solid #333;
}

#log-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    background: #0d1117;
    padding: 12px;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#log-content::-webkit-scrollbar {
    width: 8px;
}

#log-content::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

#log-content::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

#log-content::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
}

.log-timestamp {
    color: #6e7681;
    margin-right: 8px;
}

.log-info {
    color: #58a6ff;
}

.log-success {
    color: #3fb950;
}

.log-warning {
    color: #d29922;
}

.log-error {
    color: #f85149;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
}
