/* ============ Global Styles ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============ Container ============ */
.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ============ Header ============ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

/* ============ Content ============ */
.content {
    padding: 30px;
}

/* ============ Canvas Wrapper ============ */
.canvas-wrapper {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#signatureCanvas {
    display: block;
    cursor: crosshair;
    touch-action: none;
    background: white;
    width: 100%;
    height: 400px;
}

/* ============ Controls ============ */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* ============ Buttons ============ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #efefef;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3838;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 71, 87, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============ Status Panel ============ */
.status-panel {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.status-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.status-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* ============ Messages ============ */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.show {
    display: block;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ Info Box ============ */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    color: #1565c0;
    margin-top: 20px;
    line-height: 1.6;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
}

/* ============ Pointer Info ============ */
.pointer-info {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* ============ Pressure Indicator ============ */
.pressure-indicator {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.pressure-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.05s ease;
    border-radius: 10px;
}

/* ============ Footer (KronStudio Attribution) ============ */
footer {
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
    font-size: 11px;
    color: #666;
    line-height: 1.5;
}

footer strong {
    font-weight: 600;
}

footer strong[style*="color: #667eea"] {
    color: #667eea;
    font-weight: 700;
}
