/**
 * app.css - Estilos da aplicação
 */
:root {
--primary: #667eea;
--primary-dark: #5a67d8;
--secondary: #764ba2;
--gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--text-dark: #1a202c;
--text-light: #718096;
--white: #ffffff;
--gray-light: #f7fafc;
--gray-lighter: #edf2f7;
--success: #48bb78;
--error: #f56565;
--warning: #ed8936;
--info: #4299e1;
}

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

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
/* Loading Screen */
.loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--gradient);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
z-index: 10000;
transition: opacity 0.3s;
}
.loading-screen.hidden {
opacity: 0;
pointer-events: none;
}
.loader-spinner {
width: 50px;
height: 50px;
border: 4px solid rgba(255,255,255,0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Container */
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
overflow: hidden;
}
/* Header */
.header {
background: var(--gradient);
color: white;
padding: 20px 30px;
display: flex;
justify-content: space-between;
align-items: center;
}
.header h1 {
font-size: 24px;
display: flex;
align-items: center;
gap: 10px;
}
.header h1 img {
height: 32px;
}
.header-actions {
display: flex;
gap: 15px;
align-items: center;
}
.trial-info {
background: rgba(255, 255, 255, 0.2);
padding: 5px 12px;
border-radius: 20px;
font-size: 14px;
}
.trial-info.warning {
background: rgba(237, 137, 54, 0.2);
}
.trial-info.error {
background: rgba(245, 101, 101, 0.2);
}
.user-info {
padding: 8px 15px;
background: rgba(255, 255, 255, 0.2);
border-radius: 10px;
}
/* Buttons */
.btn {
padding: 10px 20px;
border: none;
border-radius: 8px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
display: inline-block;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-white {
background: white;
color: var(--primary);
}
.btn-white:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.btn-primary {
background: var(--gradient);
color: white;
padding: 12px 30px;
font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}
.btn-secondary {
background: #6c757d;
color: white;
}
.btn-secondary:hover:not(:disabled) {
background: #5a6268;
}
/* Main Layout */
.main-layout {
display: grid;
grid-template-columns: 350px 1fr;
min-height: calc(100vh - 200px);
}
/* Sidebar */
.sidebar {
background: var(--gray-light);
padding: 25px;
border-right: 1px solid #e2e8f0;
overflow-y: auto;
}
.sidebar section {
margin-bottom: 30px;
}
.sidebar h3 {
margin-bottom: 15px;
font-size: 16px;
color: var(--text-dark);
}
/* Template Grid */
.template-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-bottom: 20px;
}
.template-card {
border: 2px solid #e2e8f0;
border-radius: 8px;
padding: 12px;
cursor: pointer;
transition: all 0.3s;
text-align: center;
background: white;
}
.template-card:hover {
border-color: var(--primary);
transform: translateY(-2px);
}
.template-card.active {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.template-icon {
font-size: 20px;
margin-bottom: 5px;
}
.template-name {
font-size: 12px;
font-weight: 500;
color: var(--text-dark);
}
/* Form Controls */
.form-section {
margin-bottom: 20px;
}
.form-section label {
display: block;
margin-bottom: 8px;
color: var(--text-dark);
font-weight: 500;
font-size: 14px;
}
.form-control {
width: 100%;
padding: 10px;
border: 2px solid #e2e8f0;
border-radius: 8px;
font-size: 14px;
transition: all 0.3s;
}
.form-control:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
/* Preview Container */
.preview-container {
padding: 30px;
background: #f8f9fa;
display: flex;
justify-content: center;
overflow-y: auto;
}
.prescription-preview {
width: 210mm;
min-height: 297mm;
background: white;
padding: 40px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
/* Prescription Header */
.prescription-header {
padding: 20px;
margin-bottom: 30px;
border-radius: 8px;
background: linear-gradient(to right, #f7fafc 0%, white 100%);
border-left: 4px solid var(--primary);
}
.clinic-logo {
max-width: 150px;
max-height: 60px;
object-fit: contain;
margin-bottom: 15px;
}
.doctor-info h2 {
color: var(--text-dark);
font-size: 20px;
margin-bottom: 5px;
}
.doctor-info p {
color: var(--text-light);
margin: 3px 0;
font-size: 14px;
}
/* Patient Info */
.patient-info {
margin-bottom: 30px;
padding: 15px;
background: var(--gray-light);
border-radius: 8px;
}
.patient-info p {
margin: 5px 0;
}
/* Prescription Content */
.prescription-content {
min-height: 400px;
margin-bottom: 30px;
}
.prescription-text-area {
width: 100%;
min-height: 400px;
padding: 20px;
border: 1px solid #e2e8f0;
border-radius: 8px;
font-size: 14px;
line-height: 1.8;
outline: none;
}
.prescription-text-area:focus {
    border-color: var(--primary);
}

/* Dynamic blank lines and placeholders */
.blank-line {
    display: inline-block;
    min-width: 200px;
    border-bottom: 1px solid #000;
}

.blank-line.short {
    min-width: 60px;
}

.blank-line:empty::before {
    content: '\00a0';
}

.placeholder:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
}
/* Signature Section */
.signature-section {
margin-top: 50px;
text-align: center;
}
.signature-canvas {
border: 2px dashed #e2e8f0;
border-radius: 8px;
cursor: crosshair;
background: white;
margin: 20px auto;
display: block;
}
.signature-line {
width: 300px;
margin: 0 auto;
padding-top: 10px;
border-top: 2px solid #333;
}
.signature-line p {
margin: 5px 0;
}
.signature-line p:first-child {
font-weight: 600;
}
.signature-line p:last-child {
color: var(--text-light);
font-size: 13px;
}
/* Action Buttons */
.action-buttons {
padding: 20px 30px;
background: white;
border-top: 1px solid #e2e8f0;
display: flex;
justify-content: center;
gap: 15px;
flex-wrap: wrap;
}
/* Toast */
.toast {
position: fixed;
bottom: 20px;
right: 20px;
padding: 15px 20px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
transform: translateY(100px);
opacity: 0;
transition: all 0.3s;
z-index: 1000;
font-weight: 500;
max-width: 400px;
}
.toast.show {
transform: translateY(0);
opacity: 1;
}
.toast.success {
background: var(--success);
color: white;
}
.toast.error {
background: var(--error);
color: white;
}
.toast.warning {
background: var(--warning);
color: white;
}
.toast.info {
background: var(--info);
color: white;
}
/* Modal */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
align-items: center;
justify-content: center;
}
.modal.show {
display: flex;
}
.modal-content {
background: white;
border-radius: 16px;
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
animation: slideUp 0.3s;
}
@keyframes slideUp {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.modal-header {
padding: 20px;
border-bottom: 1px solid var(--gray-lighter);
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h2 {
font-size: 20px;
color: var(--text-dark);
}
.modal-close {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: var(--text-light);
}
.modal-body {
    padding: 20px;
}

.modal-actions {
    padding: 20px;
    border-top: 1px solid var(--gray-lighter);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
/* History List */
.history-list {
max-height: 400px;
overflow-y: auto;
}
.history-item {
padding: 15px;
border: 1px solid var(--gray-lighter);
border-radius: 8px;
margin-bottom: 10px;
cursor: pointer;
transition: all 0.3s;
display: grid;
grid-template-columns: 1fr auto auto;
gap: 15px;
align-items: center;
}
.history-item:hover {
background: var(--gray-light);
transform: translateX(5px);
}
.history-patient {
font-weight: 600;
color: var(--text-dark);
}
.history-date {
color: var(--text-light);
font-size: 14px;
}
.history-type {
background: var(--primary);
color: white;
padding: 4px 10px;
border-radius: 12px;
font-size: 12px;
}
/* Responsive */
@media (max-width: 1024px) {
.main-layout {
grid-template-columns: 1fr;
}
.sidebar {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
}
}
@media (max-width: 768px) {
body {
padding: 0;
}
.container {
    border-radius: 0;
}

.header {
    padding: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    font-size: 18px;
}

.header-actions {
    width: 100%;
    justify-content: space-between;
}

.prescription-preview {
    width: 100%;
    min-height: auto;
    padding: 20px;
}

.template-grid {
    grid-template-columns: 1fr;
}

.action-buttons {
    padding: 15px;
}

.history-item {
    grid-template-columns: 1fr;
    gap: 5px;
}
}
/* Print Styles */
@media print {
body {
background: white;
padding: 0;
}
.container {
    box-shadow: none;
    border-radius: 0;
}

.header,
.sidebar,
.action-buttons,
.loading-screen,
.toast,
.modal {
    display: none !important;
}

.main-layout {
    display: block;
}

.preview-container {
    padding: 0;
    background: white;
}

.prescription-preview {
    box-shadow: none;
    width: 100%;
    padding: 20mm;
}

.prescription-text-area {
    border: none;
}
}