:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #0ea5e9;
    --success: #10b981;
    --error: #ef4444;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

.workspace-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 100vh;
}

.full-workspace {
    max-width: 1450px;
    width: 100%;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-circle {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
}

h1 .accent {
    background: linear-gradient(to right, #6366f1, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Card Layout Grid */
.card-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Form Styles */
.form-panel {
    display: flex;
    flex-direction: column;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary);
}

.form-grid-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.highlighted-card-section {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
}

.full-width {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    color: white;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
    resize: vertical;
}

/* Logo selection styling */
.logo-selection-box {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.logo-select {
    flex-grow: 1;
}

.logo-upload-btn {
    position: relative;
    overflow: hidden;
}

.hidden-input-file {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.upload-icon-btn {
    white-space: nowrap;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.upload-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.error-text {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.25rem;
}

/* Color Picker Styling */
.color-picker-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.hex-input {
    width: 100%;
    text-transform: uppercase;
}

/* File Upload Styling */
.file-upload {
    position: relative;
}

.file-upload input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.file-label:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.action-area {
    margin-top: 2.5rem;
}

.btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

.btn-loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.status-alert {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
    color: #38bdf8;
    align-items: flex-start;
}

/* Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 2rem;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-title i {
    color: var(--accent);
}

.preview-wrapper {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    height: 750px;
}

.preview-header {
    background: #e2e8f0;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.preview-subject-label {
    font-weight: 700;
    margin-left: 0.75rem;
}

.preview-subject-value {
    color: #1e293b;
    font-weight: 500;
}

.preview-iframe {
    border: none;
    width: 100%;
    flex-grow: 1;
    background: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

/* Responsive Grid Adjustments */
@media (max-width: 1100px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .preview-panel {
        position: static;
    }
    
    .preview-wrapper {
        height: 600px;
    }
}

@media (max-width: 640px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 0;
    }
    .form-grid-inner {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
    .workspace-container {
        padding: 0;
    }
}

/* Send mode toggle */
.send-mode-toggle {
    margin-bottom: 0.75rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 2.8rem;
    height: 1.5rem;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    transition: background 0.25s, border-color 0.25s;
    flex-shrink: 0;
}

.toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: #fff;
    border-radius: 50%;
    transition: left 0.25s;
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-label input[type="checkbox"]:checked::after {
    left: calc(100% - 3px - 1rem);
}

.toggle-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.toggle-label:hover .toggle-text {
    color: var(--text-main);
}