/**
 * Custom Emergency Alert Generator - Custom Styles
 */

:root {
    --alert-red: #d32f2f;
    --alert-orange: #ff6b00;
    --alert-yellow: #ffa000;
    --danger-gradient: linear-gradient(135deg, #d32f2f 0%, #ff6b00 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --text-dark: #1a1a1a;
    --text-light: #616161;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #fef5e7 0%, #fadbd8 100%);
    min-height: 100vh;
}

.tool-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Header Section */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(211, 47, 47, 0.15);
    border-top: 4px solid var(--alert-red);
}

.tool-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    background: var(--danger-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.credit-badge {
    display: inline-block;
    background: var(--danger-gradient);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

/* Workspace Layout */
.tool-workspace {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .tool-workspace {
        grid-template-columns: 1fr;
    }
}

/* Form Panel */
.form-panel {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.form-panel::-webkit-scrollbar {
    width: 8px;
}

.form-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-panel::-webkit-scrollbar-thumb {
    background: var(--alert-red);
    border-radius: 10px;
}

.form-panel h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.quick-select-notice {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--alert-orange);
    font-size: 0.9rem;
    color: #e65100;
}

.quick-select-notice strong {
    color: #bf360c;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.form-group label .required {
    color: var(--alert-red);
    margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--alert-red);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d32f2f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.field-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Buttons */
.btn-primary,
.btn-success,
.btn-secondary {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--danger-gradient);
    color: white;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    margin-bottom: 0.75rem;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    margin-bottom: 0.75rem;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
    transform: translateY(-2px);
}

.btn-primary:disabled,
.btn-success:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.loading {
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Tips Section */
.tips-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-radius: 12px;
    color: #c62828;
    border: 2px solid #ef5350;
}

.tips-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #b71c1c;
}

.tips-section ul {
    list-style: none;
    padding-left: 0;
}

.tips-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tips-section li::before {
    content: '⚠';
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Preview Panel */
.preview-panel {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.preview-panel h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.canvas-container {
    background: #263238;
    border: 2px solid #37474f;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: auto;
    max-height: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border-radius: 8px;
    background: white;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-note {
    text-align: center;
    color: var(--text-light);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .form-panel,
    .preview-panel {
        padding: 1.5rem;
    }
    
    .canvas-container {
        padding: 1rem;
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success-gradient);
}

.notification.error {
    background: var(--danger-gradient);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
