/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Settings Panel */
.settings-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Email Panel */
.email-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Preview Panel */
.preview-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

textarea {
    min-height: 200px;
    resize: vertical;
}

/* Input with Icons */
.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    z-index: 1;
}

.input-with-icon input,
.input-with-icon textarea {
    padding-left: 40px;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.input-with-icon input:focus,
.input-with-icon textarea:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.textarea-container i {
    top: 1.2rem;
    transform: none;
}

.textarea-container textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select Styles */
.select-security {
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #495057;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.select-security:hover {
    border-color: #80bdff;
}

.select-security:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Input with icon adjustments for select */
.input-with-icon select {
    padding-left: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23495057' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Tooltip styles */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: #333;
    color: white;
    font-size: 0.85rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(145deg, #6c757d, #5a6268);
    color: white;
    border: 1px solid #545b62;
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #5a6268, #495057);
    border-color: #494f54;
}

.btn-info {
    background: linear-gradient(145deg, #17a2b8, #138496);
    color: white;
    border: 1px solid #117a8b;
}

.btn-info:hover {
    background: linear-gradient(145deg, #138496, #0f6674);
    border-color: #0e6471;
}

.btn-sample {
    background: linear-gradient(145deg, #28a745, #218838);
    color: white;
    border: 1px solid #1e7e34;
}

.btn-sample:hover {
    background: linear-gradient(145deg, #218838, #1e7e34);
    border-color: #1c7430;
}

.btn-sample::before {
    content: '📧';
    margin-right: 8px;
}

.btn-info::before {
    content: '🔍';
    margin-right: 8px;
}

/* Primary Button (Send Email) */
.btn-primary {
    background: linear-gradient(145deg, #0d6efd, #0b5ed7);
    color: white;
    border: 1px solid #0a58ca;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #0b5ed7, #0a58ca);
    border-color: #0a53be;
    transform: translateY(-1px);
}

.btn-primary:active {
    background: linear-gradient(145deg, #0a58ca, #094db3);
    transform: translateY(0);
}

.btn-primary i {
    margin-right: 8px;
    font-size: 1rem;
}

.btn-primary:disabled {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

/* Loading state animation */
.btn-primary:disabled i {
    animation: sending 1s infinite;
}

@keyframes sending {
    0% { transform: translateX(0); }
    50% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
    transform: none;
    box-shadow: none;
}

/* Debug Log Styles */
.debug-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.debug-content {
    background-color: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    height: 300px;
    overflow-y: auto;
}

.debug-header {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #dee2e6;
}

.debug-controls {
    display: flex;
    gap: 0.8rem;
}

.debug-toggle {
    margin-top: 1.5rem;
    text-align: left;
    padding: 0 20px;
}

/* Preview Content */
.preview-content {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-height: 300px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .preview-panel {
        max-height: 500px;
    }
}

/* Additional Styles */
h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

h3 {
    margin: 1rem 0;
    color: #666;
}

.input-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.button-group .checkbox-label {
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.alert {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
